Skip to content

Commit 3966168

Browse files
committed
feat: Leverage the new unparse method
1 parent c31f07e commit 3966168

File tree

5 files changed

+10
-842
lines changed

5 files changed

+10
-842
lines changed

src/Input/ChildCommandFactory.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
use Symfony\Component\Console\Input\InputDefinition;
1717
use Symfony\Component\Console\Input\InputInterface;
1818
use Webmozart\Assert\Assert;
19+
use function array_diff;
1920
use function array_filter;
21+
use function array_keys;
2022
use function array_map;
23+
use function count;
2124
use function Safe\getcwd;
2225
use function sprintf;
2326

@@ -69,19 +72,22 @@ private function getForwardedOptions(InputInterface $input): array
6972
// Forward all the options except for "processes" to the children
7073
// this way the children can inherit the options such as env
7174
// or no-debug.
72-
return InputOptionsSerializer::serialize(
73-
$this->commandDefinition,
74-
$input,
75+
$forwardedOptionNames = array_diff(
76+
array_keys($input->getRawOptions()),
7577
ParallelizationInput::OPTIONS,
7678
);
79+
80+
return count($forwardedOptionNames) === 0
81+
? []
82+
: $input->unparse($forwardedOptionNames);
7783
}
7884

7985
/**
8086
* @return list<string|bool|int|float|null|array<string|bool|int|float|null>>
8187
*/
8288
private static function getArguments(InputInterface $input): array
8389
{
84-
$arguments = RawInput::getRawArguments($input);
90+
$arguments = $input->getRawArguments();
8591

8692
// Remove the item: we do not want it to be passed to child processes
8793
// ever.

src/Input/InputOptionsSerializer.php

Lines changed: 0 additions & 102 deletions
This file was deleted.

src/Input/RawInput.php

Lines changed: 0 additions & 99 deletions
This file was deleted.

0 commit comments

Comments
 (0)