Seb35 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/299381

Change subject: [phpmd] Nullify 'unusedcode' ruleset; and by the way fix a 
minor bug
......................................................................

[phpmd] Nullify 'unusedcode' ruleset; and by the way fix a minor bug
---
M src/MediaWikiFarm.php
1 file changed, 6 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiFarm 
refs/changes/81/299381/1

diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php
index 12937ac..9ee7e19 100644
--- a/src/MediaWikiFarm.php
+++ b/src/MediaWikiFarm.php
@@ -235,7 +235,7 @@
                
                $wgConf->suffixes = array( $this->wiki['suffix'] );
                $wikiIDs = $this->readFile( $this->configDir . '/' . 
$this->wiki['suffix'] . '/wikis.yml' );
-               foreach( $wikiIDs as $wiki => $value ) {
+               foreach( array_keys( $wikiIDs ) as $wiki ) {
                        $wgConf->wikis[] = $wiki . '-' . $this->wiki['suffix'];
                }
        }
@@ -374,7 +374,7 @@
                        $filename = $variable['file'];
                        
                        # Really check if the variable is in the listing file
-                       $this->setWikiPropertyValue( $filename, false, false, 
true );
+                       $this->setWikiPropertyValue( $filename, false, true );
                        $choices = $this->readFile( $this->configDir . '/' . 
$filename );
                        if( $choices === false ) {
                                $this->unusable = true;
@@ -492,7 +492,7 @@
                        else return;
                }
                
-               $this->setWikiPropertyValue( $this->wiki[$name], $toArray, 
$create, $reset );
+               $this->setWikiPropertyValue( $this->wiki[$name], $toArray, 
$reset );
        }
        
        /**
@@ -500,11 +500,10 @@
         * 
         * @param string|null $value Value of the property.
         * @param bool $toArray Change a string to an array with the string.
-        * @param bool $create Create the property the empty string if 
non-existent.
         * @param bool $reset Empty the variables internal cache after 
operation.
         * @return void
         */
-       private function setWikiPropertyValue( &$value, $toArray = false, 
$create = false, $reset = false ) {
+       private function setWikiPropertyValue( &$value, $toArray = false, 
$reset = false ) {
                
                static $rkeys = array(), $rvalues = array();
                if( count( $rkeys ) == 0 ) {
@@ -818,7 +817,7 @@
                        
                                wfLoadSkin( $skin );
                        
-                       unset( $skins[$skin]['_loading'] );
+                       unset( 
$this->wiki['globals']['skins'][$skin]['_loading'] );
                }
                
                // Set skin parameters as global variables
@@ -851,7 +850,7 @@
                                
                                wfLoadExtension( $extension );
                        
-                       unset( $extensions[$extension]['_loading'] );
+                       unset( 
$this->wiki['globals']['extensions'][$extension]['_loading'] );
                }
                
                // Set extension parameters as global variables

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b5cd3c29a1847b70bfd498a3c907d6924e1af32
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MediaWikiFarm
Gerrit-Branch: master
Gerrit-Owner: Seb35 <seb35wikipe...@gmail.com>

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

Reply via email to