Open
Description
Q | A |
---|---|
Feature PR | symfony/symfony#59340 |
PR author(s) | @yceruto |
Merged in | 7.3 |
We created this issue to not forget to document this new feature. We would really appreciate if you can help us with this task. If you are not sure how to do it, please ask us and we will help you.
To fix this issue, please create a PR against the 7.3 branch in the symfony-docs repository.
Thank you! 😃
Activity
chalasr commentedon Jan 11, 2025
needs to be taken into account when tackling this:
chalasr commentedon Jan 20, 2025
Also
yceruto commentedon Jan 25, 2025
Also symfony/symfony#59565
tacman commentedon Feb 13, 2025
Until the documentation is written, is there an example of a trivial command using input attributes? Thx.
chalasr commentedon Feb 13, 2025
@tacman You can find one in the code PR: symfony/symfony#59340
tacman commentedon Feb 13, 2025
Here's a working example:
yceruto commentedon Mar 4, 2025
I've started looking into this and have a question: should we replace the old signature everywhere or just add a new section for the new one?
OskarStark commentedon Mar 4, 2025
I would just add a new one
alamirault commentedon Mar 18, 2025
I think the new attribute approach will be the new standard right ?
(readonly and final classes, no inheritance, same DX than for controllers)
Newcomers to symfony shouldn't see it first ? (to see how powerfull is it)
yceruto commentedon Mar 19, 2025
I’d go with @alamirault’s view on this, but let’s wait a bit to hear other opinions.
OskarStark commentedon Mar 19, 2025
It is not feature complete now compared to the old way, so I would still propose the old version first.
@chalasr what do you think?
2 remaining items
TomasVotruba commentedon Mar 21, 2025
Love this feature, amazing work @yceruto 👏
@chalasr thanks for sharing your slides, that got me into this :)
FYI, I'm working on @rectorphp rule, so people can use the day Symfony 7.3 is out:
rectorphp/rector-symfony#707
It's WIP, so any documentation PR would be helpful to understand the new concept 🙏
yceruto commentedon Mar 29, 2025
Also #20838
\Closure
functio… #20838javiereguiluz commentedon Apr 16, 2025
My vote would be to update ALL code examples to use the new and modern way of creating commands. I'd also add a secondary section in the main
/console
page showing how to define commands and add argument/options (and get their values in code) using the previous base class and methods.xabbuh commentedon Apr 17, 2025
I think I agree with Yonel and Javier.
yceruto commentedon Apr 17, 2025
I think we have a consensus, so I will do my best to propose the doc improvements before the release!
garak commentedon Apr 26, 2025
I guess that this needs attention too: https://symfony.com/doc/7.3/console.html#testing-commands
yceruto commentedon Apr 28, 2025
@garak Good point! However, nothing changes when it comes to E2E testing for console commands (which is exactly what the code in the link you shared covers: https://symfony.com/doc/7.3/console.html#testing-commands).
Note that for all cases, an invokable command will be wrapped into a
Command
instance (viasetCode()
method), so this line won't resolve the invokable command service but its Command instance instead:yceruto commentedon May 1, 2025
Let's start with something #20932 help wanted
chalasr commentedon May 9, 2025
Maybe to take into account: symfony/symfony#60389
chalasr commentedon May 9, 2025
symfony/symfony#59602 also
chalasr commentedon Jun 13, 2025
See symfony/symfony#60767 for 7.4