https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114818

Revision: 114818
Author:   netbrain
Date:     2012-04-10 07:46:23 +0000 (Tue, 10 Apr 2012)
Log Message:
-----------
removed duplicate class property, fixed loop condition so it would enter loop.

Modified Paths:
--------------
    trunk/extensions/Validator/includes/Validator.php

Modified: trunk/extensions/Validator/includes/Validator.php
===================================================================
--- trunk/extensions/Validator/includes/Validator.php   2012-04-10 05:34:03 UTC 
(rev 114817)
+++ trunk/extensions/Validator/includes/Validator.php   2012-04-10 07:46:23 UTC 
(rev 114818)
@@ -78,11 +78,6 @@
         * @var boolean
         */
        protected $unknownInvalid;
-
-       /**
-        * @var array
-        */
-       protected $paramsTohandle;
        
        /**
         * Constructor.
@@ -272,7 +267,8 @@
        protected function doParamProcessing() {
                $this->getParamsToProcess( array(), $this->parameters );
 
-               while ( $paramName = array_shift( $this->paramsTohandle ) ) {
+               while ( count($this->paramsToHandle) > 0 ) {
+                       $paramName = array_shift( $this->paramsToHandle );
                        $parameter = $this->parameters[$paramName];
 
                        $setUservalue = $this->attemptToSetUserValue( 
$parameter );
@@ -318,16 +314,16 @@
         */
        protected function getParamsToProcess( array $initialParamSet, array 
$resultingParamSet ) {
                if ( count( $initialParamSet ) == 0 ) {
-                       $this->paramsTohandle = array_keys( $resultingParamSet 
);
+                       $this->paramsToHandle = array_keys( $resultingParamSet 
);
                }
                else {
-                       if ( !is_array( $this->paramsTohandle ) ) {
-                               $this->paramsTohandle = array();
+                       if ( !is_array( $this->paramsToHandle ) ) {
+                               $this->paramsToHandle = array();
                        }                       
                        
                        foreach ( $resultingParamSet as $paramName => 
$parameter ) {
                                if ( !array_key_exists( $paramName, 
$initialParamSet ) ) {
-                                       $this->paramsTohandle[] = $paramName;
+                                       $this->paramsToHandle[] = $paramName;
                                }
                        }       
                }
@@ -335,12 +331,12 @@
                $dependencyList = array();
 
                // Loop over the parameters to handle to create a dependency 
list.
-               foreach ( $this->paramsTohandle as $paramName ) {
+               foreach ( $this->paramsToHandle as $paramName ) {
                        $dependencies = array();
 
                        // Only include dependencies that are in the list of 
parameters to handle.
                        foreach ( 
$this->parameters[$paramName]->getDependencies() as $dependency ) {
-                               if ( in_array( $dependency, 
$this->paramsTohandle ) ) {
+                               if ( in_array( $dependency, 
$this->paramsToHandle ) ) {
                                        $dependencies[] = $dependency;
                                }
                        }
@@ -350,7 +346,7 @@
 
                $sorter = new TopologicalSort( $dependencyList, true );
 
-               $this->paramsTohandle = $sorter->doSort();
+               $this->paramsToHandle = $sorter->doSort();
        }
        
        /**


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to