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

Fatal error on drush php:cli #4923

Closed
quietone1 opened this issue Dec 12, 2021 · 3 comments
Closed

Fatal error on drush php:cli #4923

quietone1 opened this issue Dec 12, 2021 · 3 comments

Comments

@quietone1
Copy link

Describe the bug
Fatal error on drush php:cli

To Reproduce
What did you do?

dev0-web:/var/www/html$ drush php:cli

Expected behavior
What did you expect would happen?
To have an interactive shell on a Drupal site.

Actual behavior
What happened instead?

PHP Fatal error:  Declaration of Drush\Psysh\Shell::hasCommand($input) must be compatible with Psy\Shell::hasCommand(string $input): bool in /var/www/html/vendor/drush/drush/src/Psysh/Shell.php on line 37

Fatal error: Declaration of Drush\Psysh\Shell::hasCommand($input) must be compatible with Psy\Shell::hasCommand(string $input): bool in /var/www/html/vendor/drush/drush/src/Psysh/Shell.php on line 37
 [warning] Drush command terminated abnormally.
dev0-web:/var/www/html$ 

Workaround
Is there another way to do the desired action?
No

System Configuration

Q A
Drush version? 10.6.1, 10.4.0
Drupal version? 9.3.x, 9.4.x
PHP version 8.0 or 7.4
OS Linux

Same failure with Drush 9.7.3, Drupal 8.9.x, PHP 7.0.

It does work with Drush 8.4.8 ,Drupal 7.80-dev, PHP 7.3

Additional information
These are all ddev environments. I first noticed this on 2021-12-07 but as I don't use the command often I don't know what I may have done that is related to the failure.

I tried a completely fresh ddev environment (deleted the whole lot and started from scratch) and got the same failure.

@weitzman
Copy link
Member

Improved constraints in 11.x and 10.x See #4916. New releases will come out soon.

@camerongreen
Copy link

Workaround is to patch line 37 of vendor/drush/drush/src/Psysh/Shell.php look like this:

protected function hasCommand(string $input): bool

@gitressa
Copy link
Contributor

This seems to work now:

$ drush core:cli
Psy Shell v0.11.2 (PHP 8.0.18 — cli) by Justin Hileman
Drush Site-Install (Drupal 9.3.12)
>>> 

System Configuration

Q A
Drush version 11.0.9
Drupal version 9.3.12
PHP version 8.0.18
OS Ubuntu 20.04
dev env Lando

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

No branches or pull requests

4 participants