Skip to content

Commit 50e939e

Browse files
committed
Fixed files skipping based on version_compare() in Windows
1 parent c099e7c commit 50e939e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

bin/skip-linting.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@
1010
$firstLine = fgets($f);
1111
@fclose($f);
1212

13-
if (!preg_match('~<?php\\s*\\/\\/\s*lint\s*([^\d\s]+)\s*([^\s]+)\s*~i', $firstLine, $m)) {
14-
$skip = false;
13+
if (preg_match('~<?php\\s*\\/\\/\s*lint\s*([^\d\s]+)\s*([^\s]+)\s*~i', $firstLine, $m)) {
14+
$skip = version_compare(PHP_VERSION, $m[2], $m[1]) === false;
1515
}
16-
17-
$skip = isset($m[2]) && !version_compare(PHP_VERSION, $m[2], $m[1]);
1816
}
1917

2018
echo $file . ';' . ($skip ? '1' : '0') . PHP_EOL;

0 commit comments

Comments
 (0)