Skip to content

Commit 01f0cef

Browse files
clxmstaabstaabm
authored andcommitted
SkipLintProcess: Pass script by file-name instead of code
1 parent 0c27060 commit 01f0cef

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Process/SkipLintProcess.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,12 @@ class SkipLintProcess extends PhpProcess
2323
public function __construct(PhpExecutable $phpExecutable, array $filesToCheck)
2424
{
2525
$scriptPath = __DIR__ . '/../../bin/skip-linting.php';
26-
$script = file_get_contents($scriptPath);
2726

28-
if (!$script) {
27+
if (!is_file($scriptPath)) {
2928
throw new RuntimeException("skip-linting.php script not found in '$scriptPath'.");
3029
}
3130

32-
$script = str_replace('<?php', '', $script);
33-
34-
$parameters = array('-d', 'display_errors=stderr', '-r', $script);
31+
$parameters = array('-d', 'display_errors=stderr', '-f', realpath($scriptPath));
3532
parent::__construct($phpExecutable, $parameters, implode(PHP_EOL, $filesToCheck));
3633
}
3734

0 commit comments

Comments
 (0)