Skip to content

[7.x] Match Symfony's Command::setHidden declaration#31840

Merged
taylorotwell merged 1 commit into
laravel:7.xfrom
sperelson:Fix-Console-setHidden-declaration
Mar 8, 2020
Merged

[7.x] Match Symfony's Command::setHidden declaration#31840
taylorotwell merged 1 commit into
laravel:7.xfrom
sperelson:Fix-Console-setHidden-declaration

Conversation

@sperelson
Copy link
Copy Markdown
Contributor

@sperelson sperelson commented Mar 8, 2020

Source of declaration mismatch: Symfony\Component\Console\Command\Command::setHidden(bool $hidden) - vendor/symfony/console/Command/Command.php:456
symfony/console@101b74f

After installing Laravel v7.0.7 on PHP 7.3.12 via laravel new I got a few declaration mismatches with Symfony. Two in Carbon which appear to be documented and with a fix pending here: briannesbitt/Carbon#2033 and this one in
Illuminate\Console\Command::setHidden($hidden) with a mismatch to Symfony\Component\Console\Command\Command::setHidden(bool $hidden)

Installed Symfony is v5.0.5. Errors were displayed in Tinkerwell.

This very well may be a PHP 7.3 issue. Cannot replicate using PHP 7.4

Symfony\Component\Console\Command\Command::setHidden(bool $hidden)
symfony/console@101b74f
@taylorotwell taylorotwell merged commit cf85266 into laravel:7.x Mar 8, 2020
@sperelson sperelson deleted the Fix-Console-setHidden-declaration branch March 8, 2020 16:26
@sperelson
Copy link
Copy Markdown
Contributor Author

This is a fine fix as method parameter signatures should match if possible. But, my actual problem was that I am a Tinkerwell noob and didn't link my correct PHP version. 🤦‍♂

Meaning that the error was happening because of PHP 7.1....

@hopeseekr
Copy link
Copy Markdown

I'm still experiencing this problem.

  Declaration of Illuminate\Console\Command::setHidden(bool $hidden) should be compatible with Symfony\Component\Console\Command\Command::setHidden($hidden)

Brand new install of Laravel v7.

@GrahamCampbell
Copy link
Copy Markdown
Collaborator

This happens if you have the wrong version of Symfony in your vendor folder, possibly due to a global install.

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.

4 participants