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

Commit 86cf65f

Browse files
committed
Fix skip-linting process if file not found
1 parent c745523 commit 86cf65f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

bin/skip-linting.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44

55
foreach ($files as $file) {
66
$skip = false;
7-
$f = fopen($file, 'r');
8-
$firstLine = fgets($f);
9-
@fclose($f);
7+
$f = @fopen($file, 'r');
8+
if ($f) {
9+
$firstLine = fgets($f);
10+
@fclose($f);
1011

11-
if (!preg_match('~<?php\\s*\\/\\/\s*lint\s*([^\d\s]+)\s*([^\s]+)\s*~i', $firstLine, $m)) {
12-
$skip = false;
13-
}
12+
if (!preg_match('~<?php\\s*\\/\\/\s*lint\s*([^\d\s]+)\s*([^\s]+)\s*~i', $firstLine, $m)) {
13+
$skip = false;
14+
}
1415

15-
$skip = isset($m[2]) && version_compare(PHP_VERSION, $m[2], $m[1]);
16+
$skip = isset($m[2]) && version_compare(PHP_VERSION, $m[2], $m[1]);
17+
}
1618

1719
echo "$file;" . ($skip ? '1' : '0') . "\n";
1820
}

src/Process.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ public function isFinished()
247247
{
248248
$isFinished = parent::isFinished();
249249
if ($isFinished && !$this->done) {
250-
echo 'F';
251250
$this->done = true;
252251
$output = $this->getOutput();
253252
$this->processLines($output);

0 commit comments

Comments
 (0)