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

Conversation

larowlan
Copy link
Contributor

@larowlan larowlan commented Aug 18, 2022

On Drupal 10 (with symfony/console 6.2.x) I'm getting this fatal:

PHP Fatal error:  Declaration of Drush\Style\DrushStyle::choice(string $question, array $choices, mixed $default = null): mixed must be compatible with Symfony\Component\Console\Style\SymfonyStyle::choice(string $question, array $choices, mixed $default = null, bool $multiSelect = false): mixed 

This is to fix that signature difference

@@ -23,7 +23,7 @@ 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

@larowlan larowlan changed the title Fix fatal error on Drupal 10 Fix fatal error on Drupal 10 w/ symfony/console:6.2+ Aug 19, 2022
@weitzman weitzman merged commit d539194 into drush-ops:11.x Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants