r77620 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77619‎ | r77620 | r77621 >
Date:00:08, 3 December 2010
Author:reedy
Status:deferred
Tags:
Comment:
Tabbs, braces, whitespace
Modified paths:
  • /trunk/tools/code-utils/find-entries.php (modified) (history)
  • /trunk/tools/code-utils/find-long-functions.php (modified) (history)

Diff [purge]

Index: trunk/tools/code-utils/find-long-functions.php
@@ -65,7 +65,7 @@
6666 switch( $token[0] ) {
6767 case T_CURLY_OPEN:
6868 $state['depth']++;
69 - break;
 69+ break;
7070 case T_CLASS:
7171 case T_FUNCTION:
7272 # find the token giving function or class name
Index: trunk/tools/code-utils/find-entries.php
@@ -47,15 +47,15 @@
4848 }
4949
5050 if ( ( $tokens[$i][0] == T_STRING ) && $tokens[$i][1] == 'dirname' ) {
51 - do { $i++; } while ( $tokens[$i][0] == T_WHITESPACE );
 51+ do { $i++; } while ( $tokens[$i][0] == T_WHITESPACE );
5252 if ( $tokens[$i] != '(' ) return false;
53 - do { $i++; } while ( $tokens[$i][0] == T_WHITESPACE );
 53+ do { $i++; } while ( $tokens[$i][0] == T_WHITESPACE );
5454 if ( $tokens[$i][0] != T_FILE ) return false;
55 - do { $i++; } while ( $tokens[$i][0] == T_WHITESPACE );
 55+ do { $i++; } while ( $tokens[$i][0] == T_WHITESPACE );
5656 if ( $tokens[$i] != ')' ) return false;
57 - do { $i++; } while ( $tokens[$i][0] == T_WHITESPACE );
 57+ do { $i++; } while ( $tokens[$i][0] == T_WHITESPACE );
5858 if ( $tokens[$i] != '.' ) return false;
59 - do { $i++; } while ( $tokens[$i][0] == T_WHITESPACE );
 59+ do { $i++; } while ( $tokens[$i][0] == T_WHITESPACE );
6060 }
6161
6262 $filetoken = $tokens[$i];
@@ -95,8 +95,9 @@
9696 $whitelistedFunctions = array( 'define', 'defined', 'dirname', 'function_exists', 'class_exists', 'php_sapi_name', 'version_compare' );
9797
9898 $rpath = realpath( $file );
99 - if ( isset( $evaluatedFiles[$rpath] ) )
 99+ if ( isset( $evaluatedFiles[$rpath] ) ) {
100100 return $evaluatedFiles[$rpath];
 101+ }
101102 $evaluatedFiles[$rpath] = true;
102103
103104 $braces = 0;
@@ -170,7 +171,9 @@
171172 } elseif ( in_array( $tokens[$i][0], array( T_ECHO, T_PRINT ) ) ) {
172173 if ( $inDefinedConditional ) {
173174 /* Allow the echo if this file dies inside this if*/
174 - if (! $mustDieOnThisSection ) $mustDieOnThisSection = "$file uses {$tokens[$i][1]} in line {$tokens[$i][2]}";
 175+ if ( !$mustDieOnThisSection ) {
 176+ $mustDieOnThisSection = "$file uses {$tokens[$i][1]} in line {$tokens[$i][2]}";
 177+ }
175178 } else {
176179 debug( "$file uses {$tokens[$i][1]} in line {$tokens[$i][2]}" );
177180 return true;
@@ -194,7 +197,9 @@
195198 } elseif ( $tokens[$i][0] == T_INLINE_HTML ) {
196199 if ( $inDefinedConditional ) {
197200 /* Allow the echo if this file dies inside this if*/
198 - if (! $mustDieOnThisSection ) $mustDieOnThisSection = "$file outputs html in line {$tokens[$i][2]}";
 201+ if ( !$mustDieOnThisSection ) {
 202+ $mustDieOnThisSection = "$file outputs html in line {$tokens[$i][2]}";
 203+ }
199204 } else {
200205 debug( "$file outputs html in line {$tokens[$i][2]}" );
201206 return true;

Status & tagging log