mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
20 lines
504 B
PHP
20 lines
504 B
PHP
<?php
|
|
$stdin = fopen('php://stdin', 'r');
|
|
$input = stream_get_contents($stdin);
|
|
fclose($stdin);
|
|
|
|
foreach (explode(PHP_EOL, $input) as $file) {
|
|
$skip = false;
|
|
$f = @fopen($file, 'r');
|
|
if ($f) {
|
|
$firstLine = fgets($f);
|
|
@fclose($f);
|
|
|
|
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;
|
|
}
|
|
}
|
|
|
|
echo $file . ';' . ($skip ? '1' : '0') . PHP_EOL;
|
|
}
|