r91606 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91605‎ | r91606 | r91607 >
Date:21:28, 6 July 2011
Author:reedy
Status:ok
Tags:
Comment:
Fix trailing whitespace
Modified paths:
  • /trunk/tools/code-utils/check-vars.php (modified) (history)

Diff [purge]

Index: trunk/tools/code-utils/check-vars.php
@@ -97,7 +97,7 @@
9898 'session_unregister' => 'Deprecated since PHP 5.3.0.',
9999 'session_is_registered' => 'Deprecated since PHP 5.3.0.',
100100 'set_magic_quotes_runtime' => 'Deprecated since PHP 5.3.0.',
101 -
 101+
102102 'var_dump' => 'Debugging function.', //r81671#c13996
103103 //'print_r' => 'Debugging function if second parameter is not true.',
104104 'wfVarDump' => 'Debugging function.', //var_export() wrapper
@@ -239,9 +239,11 @@
240240 function setGenerateDeprecatedList( $bool = true ) {
241241 $this->generateDeprecatedList = $bool;
242242 }
 243+
243244 function getGenerateDeprecatedList() {
244245 return $this->generateDeprecatedList;
245246 }
 247+
246248 function saveDeprecatedList( $filename ) {
247249 $data = "<?php\n\$mwDeprecatedFunctions = array(\n";
248250 foreach( $this->mDeprecatedFunctionList as $depre => $classes ) {
@@ -254,9 +256,11 @@
255257 function setGenerateParentList( $bool = true ) {
256258 $this->generateParentList = $bool;
257259 }
 260+
258261 function getGenerateParentList() {
259262 return $this->generateParentList;
260263 }
 264+
261265 function saveParentList( $filename ) {
262266 global $mwParentClasses;
263267 $data = "<?php\n\$mwParentClasses = array(\n";
@@ -266,7 +270,7 @@
267271 $data .= "\n);\n\n";
268272 file_put_contents( $filename, $data );
269273 }
270 -
 274+
271275 private function initVars() {
272276 $this->mProblemCount = 0;
273277
@@ -314,7 +318,7 @@
315319
316320 /* Skip HipHop specific requires */
317321 $source = preg_replace( '/if \( isset\( \$_SERVER\[\'MW_COMPILED\'\] \) \) {\\s+require \( \'phase3\/.*\' \);\\s+} else {/', 'if ( true ) {', $source );
318 -
 322+
319323 $this->mTokens = token_get_all( $source );
320324 }
321325
@@ -370,7 +374,7 @@
371375 $this->mFunctionQualifiers = array();
372376
373377 if ( $token[0] == T_COMMENT ) {
374 - if ( substr( $token[1], 0, 2 ) == '/*' && substr( $token[1], 0, 3 ) != '/**'
 378+ if ( substr( $token[1], 0, 2 ) == '/*' && substr( $token[1], 0, 3 ) != '/**'
375379 && preg_match( '/^\s+\*(?!\/)/m', $token[1] ) && strpos( $token[1], "\$separatorTransformTable = array( ',' => '' )" ) === false ) {
376380 $this->warning( 'missed-docblock', "Multiline comment with /* in line $token[2]" );
377381 }
@@ -470,7 +474,7 @@
471475 if ( $this->mInProfilingFunction && $this->mAfterProfileOut & 1 ) {
472476 $this->warning( 'profileout', "Reached end of $this->mClass::$this->mFunction with last statement not being wfProfileOut" );
473477 }
474 -
 478+
475479 $this->mStatus = self::WAITING_FUNCTION;
476480 $this->mFunctionQualifiers = array();
477481 }
@@ -560,7 +564,7 @@
561565 // throw Exception; -> Exception is a constant
562566 // throw Exception("Foo"); -> Exception() is a function
563567 // throw new Exception("Foo"); -> Exception is a class.
564 -
 568+
565569 $this->warning( 'function-throw', "Not using new when throwing token {$token[1]} in line $token[2], function {$this->mFunction}" );
566570 }
567571 }
@@ -692,7 +696,7 @@
693697 /* Try prepending the script folder, for maintenance scripts (but see Maintenance.php:758) */
694698 $requirePath = dirname( $this->mFilename ) . "/" . $requirePath;
695699 }
696 -
 700+
697701 if ( !file_exists( $requirePath ) ) {
698702 if ( strpos( $requirePath, '$' ) === false ) {
699703 $this->warning( 'missing-requires', "Did not found the expected require of $requirePath" );
@@ -1081,7 +1085,7 @@
10821086 die (
10831087 "Usage:
10841088 php $argv[0] [options] <PHP_source_file1> <PHP_source_file2> ...
1085 -
 1089+
10861090 Options:
10871091 --generate-deprecated-list
10881092 --generate-parent-list
@@ -1120,7 +1124,7 @@
11211125 foreach ( $argv as $arg ) {
11221126 if ( substr( $arg, 0, 2 ) == '-W' )
11231127 continue;
1124 -
 1128+
11251129 $cv->load( $arg );
11261130 $cv->execute();
11271131 }

Status & tagging log