Skip to content
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

Fix fatal error on Drupal 10 w/ symfony/console:6.2+ #5209

Merged
merged 2 commits into from Sep 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src-symfony-compatibility/v6/Style/DrushStyle.php
Expand Up @@ -23,11 +23,11 @@ public function confirm(string $question, bool $default = true): bool
return parent::confirm($question, $default);
}

public function choice(string $question, array $choices, mixed $default = null): mixed
public function choice(string $question, array $choices, mixed $default = null, bool $multiSelect = false): mixed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to pass along $multiSelect in the parent::choice call a few lines down.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 fixed - to clarify this is only when we get to symfony/console 6.2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its safe to merge this now right? its compatible with symfony 4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you have a different DrushStyle for symfony4 in the src-symfony-compatibility/v4 directory.

In terms of will it break on symfony/console: 6.1 - doesn't seem like it https://3v4l.org/ZXXWg

{
// Display the choices without their keys.
$choices_values = array_values($choices);
$return = parent::choice($question, $choices_values, $default);
$return = parent::choice($question, $choices_values, $default, $multiSelect);

return array_search($return, $choices);
}
Expand Down