@@ 324-334 (lines=11) @@ | ||
321 | $this->checkRegex( $file, $text, '/^[\xFF\xFE\xEF]/', 'byte-order mark' ); |
|
322 | } |
|
323 | ||
324 | private function checkRegex( $file, $text, $regex, $desc ) { |
|
325 | if ( !preg_match( $regex, $text ) ) { |
|
326 | return; |
|
327 | } |
|
328 | ||
329 | if ( !isset( $this->mWarnings[$file] ) ) { |
|
330 | $this->mWarnings[$file] = []; |
|
331 | } |
|
332 | $this->mWarnings[$file][] = $desc; |
|
333 | $this->output( "Warning in file $file: $desc found.\n" ); |
|
334 | } |
|
335 | ||
336 | private function checkEvilToken( $file, $tokens, $evilToken, $desc ) { |
|
337 | if ( !in_array( $evilToken, $tokens ) ) { |
|
@@ 336-346 (lines=11) @@ | ||
333 | $this->output( "Warning in file $file: $desc found.\n" ); |
|
334 | } |
|
335 | ||
336 | private function checkEvilToken( $file, $tokens, $evilToken, $desc ) { |
|
337 | if ( !in_array( $evilToken, $tokens ) ) { |
|
338 | return; |
|
339 | } |
|
340 | ||
341 | if ( !isset( $this->mWarnings[$file] ) ) { |
|
342 | $this->mWarnings[$file] = []; |
|
343 | } |
|
344 | $this->mWarnings[$file][] = $desc; |
|
345 | $this->output( "Warning in file $file: $desc found.\n" ); |
|
346 | } |
|
347 | } |
|
348 | ||
349 | $maintClass = "CheckSyntax"; |