Skip to content

Commit aa0e4a0

Browse files
committed
Simplify fix
1 parent a6d4f6f commit aa0e4a0

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

.github/workflows/test.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,14 @@ jobs:
167167

168168
- name: Grab PHPUnit version
169169
id: phpunit_version
170-
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT
170+
shell: bash
171+
run: echo "VERSION=$(echo vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT
171172

172173
- name: "Run unit tests (PHPUnit < 10)"
173174
if: ${{ ! startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}
174175
run: composer test
175176

176-
- name: "Run unit tests (PHPUnit < 10)"
177+
- name: "Run unit tests (PHPUnit >= 10)"
177178
if: ${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}
178179
run: composer test10
179180

src/Process/SkipLintProcess.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@ class SkipLintProcess extends PhpProcess
2222
*/
2323
public function __construct(PhpExecutable $phpExecutable, array $filesToCheck)
2424
{
25-
$scriptPath = __DIR__ . '/../../bin/skip-linting.php';
25+
$scriptPath = dirname(dirname(__DIR__)) . '/bin/skip-linting.php';
26+
$code = sprintf("include('%s');", $scriptPath);
2627

27-
if (!is_file($scriptPath)) {
28-
throw new RuntimeException("skip-linting.php script not found in '$scriptPath'.");
29-
}
30-
31-
$parameters = array('-d', 'display_errors=stderr', '-f', realpath($scriptPath));
28+
$parameters = array('-d', 'display_errors=stderr', '-r', $code);
3229
parent::__construct($phpExecutable, $parameters, implode(PHP_EOL, $filesToCheck));
3330
}
3431

0 commit comments

Comments
 (0)