http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90250

Revision: 90250
Author:   reedy
Date:     2011-06-17 00:06:44 +0000 (Fri, 17 Jun 2011)
Log Message:
-----------
Fix case statement fall through

Fix "text" being used as a constant rather than $text

Fix some indenting

Remove some unused variables

Modified Paths:
--------------
    trunk/extensions/Validator/includes/ParameterInput.php
    trunk/extensions/Validator/includes/ParserHook.php
    trunk/extensions/Validator/includes/TopologicalSort.php
    trunk/extensions/Validator/includes/criteria/CriterionInArray.php
    trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php

Modified: trunk/extensions/Validator/includes/ParameterInput.php
===================================================================
--- trunk/extensions/Validator/includes/ParameterInput.php      2011-06-16 
23:53:10 UTC (rev 90249)
+++ trunk/extensions/Validator/includes/ParameterInput.php      2011-06-17 
00:06:44 UTC (rev 90250)
@@ -92,7 +92,6 @@
         * @return string
         */
        public function getHtml() {
-               $html = '';
                $valueList = array();
                
         foreach ( $this->param->getCriteria() as $criterion ) {
@@ -115,6 +114,7 @@
                                        break;
                                case Parameter::TYPE_BOOLEAN:
                                        $html = $this->getBooleanInput();
+                                       break;
                                case Parameter::TYPE_STRING:
                                default:
                                        $html = $this->getStrInput();

Modified: trunk/extensions/Validator/includes/ParserHook.php
===================================================================
--- trunk/extensions/Validator/includes/ParserHook.php  2011-06-16 23:53:10 UTC 
(rev 90249)
+++ trunk/extensions/Validator/includes/ParserHook.php  2011-06-17 00:06:44 UTC 
(rev 90250)
@@ -273,8 +273,6 @@
         * @return string
         */
        public function validateAndRender( array $arguments, $type ) {
-               global $egValidatorErrorLevel;
-               
                $names = $this->getNames();
                $this->validator = new Validator( $names[0] );
                
@@ -468,7 +466,7 @@
                // Parse the wikitext to HTML.
                if ( $this->isFunction() ) {
                        return $this->parser->parse(
-                               text,
+                               $text,
                                $this->parser->mTitle,
                                $this->parser->mOptions,
                                true,

Modified: trunk/extensions/Validator/includes/TopologicalSort.php
===================================================================
--- trunk/extensions/Validator/includes/TopologicalSort.php     2011-06-16 
23:53:10 UTC (rev 90249)
+++ trunk/extensions/Validator/includes/TopologicalSort.php     2011-06-17 
00:06:44 UTC (rev 90250)
@@ -36,7 +36,7 @@
                }
                
                // turn pairs into double-linked node tree
-               foreach ( $dependencies as $key => $dpair ) {
+               foreach ( $dependencies as $dpair ) {
                        list ( $module, $dependency ) = each ( $dpair );
                        if ( !isset( $this->mNodes[$module] ) ) 
$this->mNodes[$module] = new TSNode( $module );
                        if ( !isset( $this->mNodes[$dependency] ) ) 
$this->mNodes[$dependency] = new TSNode( $dependency );

Modified: trunk/extensions/Validator/includes/criteria/CriterionInArray.php
===================================================================
--- trunk/extensions/Validator/includes/criteria/CriterionInArray.php   
2011-06-16 23:53:10 UTC (rev 90249)
+++ trunk/extensions/Validator/includes/criteria/CriterionInArray.php   
2011-06-17 00:06:44 UTC (rev 90250)
@@ -89,8 +89,7 @@
         */     
        protected function getItemErrorMessage( Parameter $parameter ) {
                global $wgLang;
-               
-               $values = $parameter->getValue();
+
                $originalCount = count( $this->allowedValues );
                
                if ( $originalCount > 15 ) {
@@ -123,10 +122,9 @@
         */     
        protected function getFullListErrorMessage( Parameter $parameter ) {
                global $wgLang;
-               
-               $values = $parameter->getValue();
+
                $originalCount = count( $this->allowedValues );
-               
+
                if ( $originalCount > 15 ) {
                        $allowedValues = array_slice( $this->allowedValues, 0, 
13 );
                        $omitCount = $originalCount - count( $allowedValues );

Modified: trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php
===================================================================
--- trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php      
2011-06-16 23:53:10 UTC (rev 90249)
+++ trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php      
2011-06-17 00:06:44 UTC (rev 90250)
@@ -349,6 +349,8 @@
                foreach ( $parameters as $parameter ) {
                        $tableRows[] = $this->getDescriptionRow( $parameter, 
$defaults );
                }
+
+               $table = '';
                
                if ( count( $tableRows ) > 0 ) {
                        $tableRows = array_merge( array( 
@@ -360,17 +362,17 @@
                        '!' . wfMsg( 'validator-describe-header-description' )
                        ), $tableRows );
                        
-               $table = implode( "\n|-\n", $tableRows );
-               
-               $h3 = 
-                       ( $pre ? '=== ' : '<h3>' ) . 
-                       wfMsg( 'validator-describe-parameters' ) .
-                       ( $pre ? ' ===' : '</h3>' );
-               
-               $table = "$h3\n\n" .
-                               '{| class="wikitable sortable"' . "\n" .
-                               $table .
-                               "\n|}";
+                       $table = implode( "\n|-\n", $tableRows );
+
+                       $h3 =
+                               ( $pre ? '=== ' : '<h3>' ) .
+                               wfMsg( 'validator-describe-parameters' ) .
+                               ( $pre ? ' ===' : '</h3>' );
+
+                       $table = "$h3\n\n" .
+                                       '{| class="wikitable sortable"' . "\n" .
+                                       $table .
+                                       "\n|}";
                }
                
                return $table;


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

Reply via email to