Skip to content

Commit

Permalink
Simplify fix
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Oct 2, 2024
1 parent a6d4f6f commit 2b3c305
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Process/SkipLintProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ class SkipLintProcess extends PhpProcess
*/
public function __construct(PhpExecutable $phpExecutable, array $filesToCheck)
{
$scriptPath = __DIR__ . '/../../bin/skip-linting.php';
$scriptPath = dirname(dirname(__DIR__)) . '/bin/skip-linting.php';
$code = sprintf("include('%s');", $scriptPath);

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

$parameters = array('-d', 'display_errors=stderr', '-f', realpath($scriptPath));
$parameters = array('-d', 'display_errors=stderr', '-r', $code);
parent::__construct($phpExecutable, $parameters, implode(PHP_EOL, $filesToCheck));
}

Expand Down

0 comments on commit 2b3c305

Please sign in to comment.