jenkins-bot has submitted this change and it was merged.

Change subject: Attempt to fix problems noted in phpcs.
......................................................................


Attempt to fix problems noted in phpcs.

Seen at
https://integration.wikimedia.org/ci/job/mediawiki-core-regression-phpcs-HEAD/3256/console

Change-Id: If1272366fa242ccdf1191ba1686f2d1cdf046872
---
M includes/HttpFunctions.php
1 file changed, 18 insertions(+), 10 deletions(-)

Approvals:
  IAlex: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php
index 6fcb7ce..f2e69b8 100644
--- a/includes/HttpFunctions.php
+++ b/includes/HttpFunctions.php
@@ -30,7 +30,7 @@
  * @ingroup HTTP
  */
 class Http {
-       static $httpEngine = false;
+       static public $httpEngine = false;
 
        /**
         * Perform an HTTP request
@@ -130,7 +130,8 @@
                        $domainParts = array_reverse( $domainParts );
 
                        $domain = '';
-                       for ( $i = 0; $i < count( $domainParts ); $i++ ) {
+                       $countParts = count( $domainParts );
+                       for ( $i = 0; $i < $countParts; $i++ ) {
                                $domainPart = $domainParts[$i];
                                if ( $i == 0 ) {
                                        $domain = $domainPart;
@@ -294,8 +295,10 @@
                                return new CurlHttpRequest( $url, $options );
                        case 'php':
                                if ( !wfIniGetBool( 'allow_url_fopen' ) ) {
-                                       throw new MWException( __METHOD__ . ': 
allow_url_fopen needs to be enabled for pure PHP' .
-                                               ' http requests to work. If 
possible, curl should be used instead. See http://php.net/curl.' );
+                                       throw new MWException( __METHOD__ . ': 
allow_url_fopen '.
+                                               'needs to be enabled for pure 
PHP http requests to '.
+                                               'work. If possible, curl should 
be used instead. See '.
+                                               'http://php.net/curl.' );
                                }
                                return new PhpHttpRequest( $url, $options );
                        default:
@@ -642,12 +645,16 @@
        /**
         * Returns the final URL after all redirections.
         *
-        * Relative values of the "Location" header are incorrect as stated in 
RFC, however they do happen and modern browsers support them.
-        * This function loops backwards through all locations in order to 
build the proper absolute URI - Marooned at wikia-inc.com
+        * Relative values of the "Location" header are incorrect as
+        * stated in RFC, however they do happen and modern browsers
+        * support them.  This function loops backwards through all
+        * locations in order to build the proper absolute URI - Marooned
+        * at wikia-inc.com
         *
-        * Note that the multiple Location: headers are an artifact of CURL -- 
they
-        * shouldn't actually get returned this way. Rewrite this when bug 
29232 is
-        * taken care of (high-level redirect handling rewrite).
+        * Note that the multiple Location: headers are an artifact of
+        * CURL -- they shouldn't actually get returned this way. Rewrite
+        * this when bug 29232 is taken care of (high-level redirect
+        * handling rewrite).
         *
         * @return string
         */
@@ -678,7 +685,8 @@
                                } else {
                                        $url = parse_url( $this->url );
                                        if ( isset( $url['host'] ) ) {
-                                               return $url['scheme'] . '://' . 
$url['host'] . $locations[$countLocations - 1];
+                                               return $url['scheme'] . '://' . 
$url['host'] .
+                                                       
$locations[$countLocations - 1];
                                        }
                                }
                        } else {

-- 
To view, visit https://gerrit.wikimedia.org/r/100559
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If1272366fa242ccdf1191ba1686f2d1cdf046872
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MarkAHershberger <mhershber...@wikimedia.org>
Gerrit-Reviewer: IAlex <coderev...@emsenhuber.ch>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to