Merge "Add config for serving main Page from the domain root"
[lhc/web/wiklou.git] / includes / http / HttpRequestFactory.php
index 08520b7..510d26d 100644 (file)
@@ -58,10 +58,14 @@ class HttpRequestFactory {
         *    - password            Password for HTTP Basic Authentication
         *    - 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
+        * @codingStandardsIgnoreEnd
         * @param string $caller The method making this request, for profiling
         * @throws RuntimeException
         * @return MWHttpRequest
         * @see MWHttpRequest::__construct
+        * @suppress PhanUndeclaredTypeParameter
         */
        public function create( $url, array $options = [], $caller = __METHOD__ ) {
                if ( !Http::$httpEngine ) {
@@ -140,7 +144,7 @@ class HttpRequestFactory {
         * @return string|null
         */
        public function get( $url, array $options = [], $caller = __METHOD__ ) {
-               $this->request( 'GET', $url, $options, $caller );
+               return $this->request( 'GET', $url, $options, $caller );
        }
 
        /**
@@ -153,7 +157,7 @@ class HttpRequestFactory {
         * @return string|null
         */
        public function post( $url, array $options = [], $caller = __METHOD__ ) {
-               $this->request( 'POST', $url, $options, $caller );
+               return $this->request( 'POST', $url, $options, $caller );
        }
 
        /**