Skip to content

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

Merged
weitzman merged 2 commits intodrush-ops:11.xfrom
larowlan:fix-choices
Sep 3, 2022
Merged

Fix fatal error on Drupal 10 w/ symfony/console:6.2+#5209
weitzman merged 2 commits intodrush-ops:11.xfrom
larowlan:fix-choices

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

}

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.

3 participants