Skip to content

Commit c0e70dd

Browse files
authored
feat: Improve the type of the php executable finder (#333)
1 parent d10c056 commit c0e70dd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Process/PhpExecutableFinder.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use Symfony\Component\Process\PhpExecutableFinder as SymfonyPhpExecutableFinder;
1717
use Webmozart\Assert\Assert;
18+
use function array_values;
1819

1920
final class PhpExecutableFinder
2021
{
@@ -36,7 +37,7 @@ public static function tryToFind(): ?string
3637
}
3738

3839
/**
39-
* @return list<string>
40+
* @return non-empty-list<string>
4041
*/
4142
public static function find(): array
4243
{
@@ -48,10 +49,10 @@ public static function find(): array
4849
'Could not find the PHP executable.',
4950
);
5051

51-
return array_merge(
52-
[$phpExecutable],
53-
$finder->findArguments(),
54-
);
52+
return array_values([
53+
$phpExecutable,
54+
...$finder->findArguments(),
55+
]);
5556
}
5657

5758
private static function getFinder(): SymfonyPhpExecutableFinder

0 commit comments

Comments
 (0)