Skip to content

Commit 60a29fa

Browse files
committed
TypeInferenceTestCase: support declare(); before // lint
1 parent 01f3e93 commit 60a29fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/Testing/TypeInferenceTestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ private static function isFileLintSkipped(string $file): bool
398398

399399
@fclose($f);
400400

401-
if (preg_match('~<?php\\s*\\/\\/\s*lint\s*([^\d\s]+)\s*([^\s]+)\s*~i', $firstLine, $m) === 1) {
401+
if (preg_match('~<?php\\s*(?:declare\\s*\([^)]+\)\\s*;\\s*)?\\/\\/\s*lint\s*([^\d\s]+)\s*([^\s]+)\s*~i', $firstLine, $m) === 1) {
402402
return version_compare(PHP_VERSION, $m[2], $m[1]) === false;
403403
}
404404
}

0 commit comments

Comments
 (0)