Merge "HTMLForm entity labels are now optional and escaped"
[lhc/web/wiklou.git] / maintenance / checkSyntax.php
index 1e44e23..efb9471 100644 (file)
@@ -221,12 +221,14 @@ class CheckSyntax extends Maintenance {
        private function isSuitableFile( $file ) {
                $file = str_replace( '\\', '/', $file );
                $ext = pathinfo( $file, PATHINFO_EXTENSION );
-               if ( $ext != 'php' && $ext != 'inc' && $ext != 'php5' )
+               if ( $ext != 'php' && $ext != 'inc' && $ext != 'php5' ) {
                        return false;
+               }
                foreach ( $this->mIgnorePaths as $regex ) {
                        $m = array();
-                       if ( preg_match( "~{$regex}~", $file, $m ) )
+                       if ( preg_match( "~{$regex}~", $file, $m ) ) {
                                return false;
+                       }
                }
                return true;
        }
@@ -328,14 +330,15 @@ class CheckSyntax extends Maintenance {
        private function checkForMistakes( $file ) {
                foreach ( $this->mNoStyleCheckPaths as $regex ) {
                        $m = array();
-                       if ( preg_match( "~{$regex}~", $file, $m ) )
+                       if ( preg_match( "~{$regex}~", $file, $m ) ) {
                                return;
+                       }
                }
 
                $text = file_get_contents( $file );
                $tokens = token_get_all( $text );
 
-               $this->checkEvilToken( $file, $tokens, '@', 'Error supression operator (@)');
+               $this->checkEvilToken( $file, $tokens, '@', 'Error supression operator (@)' );
                $this->checkRegex( $file, $text, '/^[\s\r\n]+<\?/', 'leading whitespace' );
                $this->checkRegex( $file, $text, '/\?>[\s\r\n]*$/', 'trailing ?>' );
                $this->checkRegex( $file, $text, '/^[\xFF\xFE\xEF]/', 'byte-order mark' );