Skip to content

Commit 67318ba

Browse files
committed
#62 Force Psalm to 1 thead if pcntl or posix is missing.
1 parent 361795e commit 67318ba

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Task/Psalm/PsalmTask.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@ public function buildArguments(iterable $files): ProcessArgumentsCollection {
2626
$arguments->addOptionalArgument('--config=%s', $config['config']);
2727
$arguments->addOptionalArgument('--report=%s', $config['report']);
2828
$arguments->addOptionalArgument('--no-cache', $config['no_cache']);
29-
$arguments->addOptionalArgument('--threads=%d', $config['threads']);
29+
if (!extension_loaded('pcntl') || !extension_loaded('posix')) {
30+
// Psalm will error if we don't have pcntl or posix installed as
31+
// we have increased the threads in our default configs.
32+
$arguments->addOptionalArgument('--threads=%d', 1);
33+
}
34+
else {
35+
$arguments->addOptionalArgument('--threads=%d', $config['threads']);
36+
}
3037
$arguments->add('--find-unused-code');
3138
$arguments->addOptionalBooleanArgument('--show-info=%s', $config['show_info'], 'true', 'false');
3239

0 commit comments

Comments
 (0)