Skip to content

Commit d5a0847

Browse files
committed
fix: remove code supporting old versions of symfony/process
1 parent 7df02e3 commit d5a0847

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

src/LibraryStarterKit/Setup.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,13 @@
1313

1414
use Composer\Script\Event;
1515
use Ramsey\Dev\LibraryStarterKit\Task\Build;
16-
use ReflectionClass;
17-
use ReflectionMethod;
18-
use ReflectionNamedType;
1916
use Symfony\Component\Console\Style\SymfonyStyle;
2017
use Symfony\Component\Finder\Finder;
2118
use Symfony\Component\Process\Process;
2219
use Twig\Environment as TwigEnvironment;
2320
use Twig\Loader\FilesystemLoader;
2421
use Twig\TwigFilter;
2522

26-
use function array_map;
27-
use function implode;
2823
use function preg_replace;
2924

3025
use const DIRECTORY_SEPARATOR;
@@ -114,23 +109,6 @@ public function getVerbosity(): int
114109
*/
115110
public function getProcess(array $command): Process
116111
{
117-
// Support backward-compatibility with older versions of symfony/process.
118-
$reflectedProcess = new ReflectionClass(Process::class);
119-
120-
/** @var ReflectionMethod $reflectedConstructor */
121-
$reflectedConstructor = $reflectedProcess->getConstructor();
122-
$reflectedConstructorType = $reflectedConstructor->getParameters()[0]->getType();
123-
124-
if ($reflectedConstructorType instanceof ReflectionNamedType) {
125-
if ($reflectedConstructorType->getName() !== 'array') {
126-
$command = implode(' ', array_map('escapeshellarg', $command)); // @codeCoverageIgnore
127-
}
128-
}
129-
130-
/**
131-
* @psalm-suppress PossiblyInvalidArgument
132-
* @phpstan-ignore-next-line
133-
*/
134112
return new Process($command, $this->getProject()->getPath());
135113
}
136114

0 commit comments

Comments
 (0)