Skip to content

Commit ed8d8d6

Browse files
committed
Use float value explicitly for timeout
1 parent 63542e4 commit ed8d8d6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/wp-includes/ai-client/class-wp-ai-client-prompt-builder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,19 @@ public function __construct( ProviderRegistry $registry, $prompt = null ) {
190190
$this->error = $this->exception_to_wp_error( $e );
191191
}
192192

193-
$default_timeout = 30;
193+
$default_timeout = 30.0;
194194

195195
/**
196196
* Filters the default request timeout in seconds for AI Client HTTP requests.
197197
*
198198
* @since 7.0.0
199199
*
200-
* @param float $default_timeout The default timeout in seconds.
200+
* @param float $default_timeout The default timeout in seconds. Must be greater than or equal to zero.
201201
*/
202202
$timeout = apply_filters( 'wp_ai_client_default_request_timeout', $default_timeout );
203203
if ( is_numeric( $timeout ) ) {
204204
$timeout = (float) $timeout;
205-
if ( $timeout >= 0 ) {
205+
if ( $timeout >= 0.0 ) {
206206
$default_timeout = $timeout;
207207
}
208208
}

0 commit comments

Comments
 (0)