Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat: Leverage the new unparse method #328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
Loading
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions 14 src/Input/ChildCommandFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
use Webmozart\Assert\Assert;
use function array_diff;
use function array_filter;
use function array_keys;
use function array_map;
use function count;
use function Safe\getcwd;
use function sprintf;

Expand All @@ -33,7 +36,7 @@
private array $phpExecutable,
private string $scriptPath,
private string $commandName,
private InputDefinition $commandDefinition,

Check failure on line 39 in src/Input/ChildCommandFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.4)

Property Webmozarts\Console\Parallelization\Input\ChildCommandFactory::$commandDefinition is never read, only written.
) {
self::validateScriptPath($scriptPath);
}
Expand Down Expand Up @@ -69,19 +72,22 @@
// Forward all the options except for "processes" to the children
// this way the children can inherit the options such as env
// or no-debug.
return InputOptionsSerializer::serialize(
$this->commandDefinition,
$input,
$forwardedOptionNames = array_diff(
array_keys($input->getRawOptions()),

Check failure on line 76 in src/Input/ChildCommandFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.4)

Call to an undefined method Symfony\Component\Console\Input\InputInterface::getRawOptions().
ParallelizationInput::OPTIONS,
);

return count($forwardedOptionNames) === 0
? []
: $input->unparse($forwardedOptionNames);

Check failure on line 82 in src/Input/ChildCommandFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.4)

Call to an undefined method Symfony\Component\Console\Input\InputInterface::unparse().
}

/**
* @return list<string|bool|int|float|null|array<string|bool|int|float|null>>
*/
private static function getArguments(InputInterface $input): array
{
$arguments = RawInput::getRawArguments($input);
$arguments = $input->getRawArguments();

Check failure on line 90 in src/Input/ChildCommandFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.4)

Call to an undefined method Symfony\Component\Console\Input\InputInterface::getRawArguments().

// Remove the item: we do not want it to be passed to child processes
// ever.
Expand Down
102 changes: 0 additions & 102 deletions 102 src/Input/InputOptionsSerializer.php

This file was deleted.

99 changes: 0 additions & 99 deletions 99 src/Input/RawInput.php

This file was deleted.

Loading
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.