From a5f1970842d7d2ee453fee2fe621f73d081f0523 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sun, 22 Sep 2019 21:29:12 +0200 Subject: [PATCH] Fix type for timeout and connectTimeout in HttpRequestFactory::create Both can have a string 'default' Change-Id: I9c49cf7db762f251b010bc5469d4c1b4a7797f45 --- includes/http/HttpRequestFactory.php | 6 +++--- includes/http/MWHttpRequest.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/http/HttpRequestFactory.php b/includes/http/HttpRequestFactory.php index 510d26d2bd..5315cede41 100644 --- a/includes/http/HttpRequestFactory.php +++ b/includes/http/HttpRequestFactory.php @@ -37,8 +37,8 @@ class HttpRequestFactory { * Generate a new MWHttpRequest object * @param string $url Url to use * @param array $options Possible keys for the array: - * - timeout Timeout length in seconds - * - connectTimeout Timeout for connection, in seconds (curl only) + * - timeout Timeout length in seconds or 'default' + * - connectTimeout Timeout for connection, in seconds (curl only) or 'default' * - postData An array of key-value pairs or a url-encoded form data * - proxy The proxy to use. * Otherwise it will use $wgHTTPProxy (if set) @@ -59,7 +59,7 @@ class HttpRequestFactory { * - originalRequest Information about the original request (as a WebRequest object or * an associative array with 'ip' and 'userAgent'). * @codingStandardsIgnoreStart - * @phan-param array{timeout?:int,connectTimeout?:int,postData?:array,proxy?:string,noProxy?:bool,sslVerifyHost?:bool,sslVerifyCert?:bool,caInfo?:string,maxRedirects?:int,followRedirects?:bool,userAgent?:string,method?:string,logger?:\Psr\Log\LoggerInterface,username?:string,password?:string,originalRequest?:WebRequest|array{ip:string,userAgent:string}} $options + * @phan-param array{timeout?:int|string,connectTimeout?:int|string,postData?:array,proxy?:string,noProxy?:bool,sslVerifyHost?:bool,sslVerifyCert?:bool,caInfo?:string,maxRedirects?:int,followRedirects?:bool,userAgent?:string,method?:string,logger?:\Psr\Log\LoggerInterface,username?:string,password?:string,originalRequest?:WebRequest|array{ip:string,userAgent:string}} $options * @codingStandardsIgnoreEnd * @param string $caller The method making this request, for profiling * @throws RuntimeException diff --git a/includes/http/MWHttpRequest.php b/includes/http/MWHttpRequest.php index d1c14aebba..0f3096ef96 100644 --- a/includes/http/MWHttpRequest.php +++ b/includes/http/MWHttpRequest.php @@ -89,7 +89,7 @@ abstract class MWHttpRequest implements LoggerAwareInterface { * @param string $url Url to use. If protocol-relative, will be expanded to an http:// URL * @param array $options (optional) extra params to pass (see HttpRequestFactory::create()) * @codingStandardsIgnoreStart - * @phan-param array{timeout?:int,connectTimeout?:int,postData?:array,proxy?:string,noProxy?:bool,sslVerifyHost?:bool,sslVerifyCert?:bool,caInfo?:string,maxRedirects?:int,followRedirects?:bool,userAgent?:string,logger?:LoggerInterface,username?:string,password?:string,originalRequest?:WebRequest|array{ip:string,userAgent:string},method?:string} $options + * @phan-param array{timeout?:int|string,connectTimeout?:int|string,postData?:array,proxy?:string,noProxy?:bool,sslVerifyHost?:bool,sslVerifyCert?:bool,caInfo?:string,maxRedirects?:int,followRedirects?:bool,userAgent?:string,logger?:LoggerInterface,username?:string,password?:string,originalRequest?:WebRequest|array{ip:string,userAgent:string},method?:string} $options * @codingStandardsIgnoreEnd * @param string $caller The method making this request, for profiling * @param Profiler|null $profiler An instance of the profiler for profiling, or null -- 2.20.1