8000
[Console] Hidden option using PHP 8 AsCommand attribute #41942
Labels
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 5.3.0 to current latest 5.3.3
Description
I always get a different behavior between hidden option in php 8 attribute (#[AsCommand]) and the
setHidden()
method in configure method even with the fix #41686. Also withcache:clear
.How to reproduce
I've created a project (see below) to simplify the tests, but :
src/Command
:Application.php
class insrc
folder and use it inbin/console
instead of the default Application class (just need to change the namespace):src/Application.php
bin/console
app:hello
with or without PHP 8 attributes.bin/console
. Update DefaultCommand with PHP 8 #[AsCommand] attribute and observe the difference.OR use the following project as exemple
https://github.com/duboiss/sfcommand
git clone https://github.com/duboiss/sfcommand cd sfcommand composer install bin/console git switch php8 bin/console
Additional context

Without attribute
With attribute

This is probably due to the fact that it has become lazy. Is there any way to keep the PHP 8 attribute and disable lazy (if that is the cause)?
The text was updated successfully, but these errors were encountered: