Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #92 from slevomat/master
Browse files Browse the repository at this point in the history
Fixed files skipping based on version_compare() in Windows
  • Loading branch information
JakubOnderka committed Feb 18, 2017
2 parents c099e7c + 50e939e commit d6181c0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bin/skip-linting.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
$firstLine = fgets($f);
@fclose($f);

if (!preg_match('~<?php\\s*\\/\\/\s*lint\s*([^\d\s]+)\s*([^\s]+)\s*~i', $firstLine, $m)) {
$skip = false;
if (preg_match('~<?php\\s*\\/\\/\s*lint\s*([^\d\s]+)\s*([^\s]+)\s*~i', $firstLine, $m)) {
$skip = version_compare(PHP_VERSION, $m[2], $m[1]) === false;
}

$skip = isset($m[2]) && !version_compare(PHP_VERSION, $m[2], $m[1]);
}

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

0 comments on commit d6181c0

Please sign in to comment.