Ensure explode is passed a string and not null

Passing `null` to `explode()` is deprecated.
This commit is contained in:
Oliver Davies 2024-02-23 16:15:41 +00:00
parent 14fbbec987
commit 52d933bc5e
3 changed files with 5 additions and 5 deletions

View file

@ -64,7 +64,7 @@ final class BuildCommand extends AbstractCommand
if ($isDockerCompose) {
$process = Process::create(
command: ['docker', 'compose', 'build'],
extraArgs: explode(separator: ' ', string: $extraArgs),
extraArgs: explode(separator: ' ', string: strval($extraArgs)),
workingDir: $workingDir,
);
@ -79,7 +79,7 @@ final class BuildCommand extends AbstractCommand
case ProjectType::Sculpin->value:
$process = Process::create(
command: ['./vendor/bin/sculpin', 'generate'],
extraArgs: explode(separator: ' ', string: $extraArgs),
extraArgs: explode(separator: ' ', string: strval($extraArgs)),
workingDir: $workingDir,
);
@ -92,7 +92,7 @@ final class BuildCommand extends AbstractCommand
case ProjectType::Fractal->value:
$process = Process::create(
command: ['npx', 'fractal', 'build'],
extraArgs: explode(separator: ' ', string: $extraArgs),
extraArgs: explode(separator: ' ', string: strval($extraArgs)),
workingDir: $workingDir,
);

View file

@ -31,7 +31,7 @@ final class InstallCommand extends AbstractCommand
language: $language,
workingDir: $workingDir,
),
extraArgs: explode(separator: ' ', string: $extraArgs),
extraArgs: explode(separator: ' ', string: strval($extraArgs)),
workingDir: $workingDir,
);

View file

@ -14,7 +14,7 @@ final class Process
/**
* @param non-empty-array<int, non-empty-string> $command
* @param string $workingDir
* @param non-empty-string[] $extraArgs
* @param string[] $extraArgs
*/
public static function create(array $command, string $workingDir, array $extraArgs = []): SymfonyProcess
{