Skip to content

Conversation

@yceruto
Copy link
Member

@yceruto yceruto commented Oct 14, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues -
License MIT

I missed including this helper in #59340 and it's particularly useful for creating dynamic console commands.

Before:

#[AsCommand('make:pizza')]
class MakePizza
{
    public function __invoke(OutputInterface $output): int
    {
        $cursor = new Cursor($output);

        // ...
    }
}

After:

#[AsCommand('make:pizza')]
class MakePizza
{
    public function __invoke(Cursor $cursor): int
    {
        // ...
    }
}

Cheers!

@yceruto yceruto requested a review from chalasr as a code owner October 14, 2025 14:25
@carsonbot carsonbot added this to the 7.4 milestone Oct 14, 2025
@yceruto yceruto added the ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" label Oct 14, 2025
@nicolas-grekas
Copy link
Member

Thank you @yceruto.

@nicolas-grekas nicolas-grekas merged commit d7b1097 into symfony:7.4 Oct 14, 2025
12 checks passed
@yceruto yceruto deleted the add_cursor_helper branch October 14, 2025 15:51
This was referenced Oct 27, 2025
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Nov 29, 2025
…(mindaugasw)

This PR was merged into the 7.4 branch.

Discussion
----------

[Console] Update Cursor helper to use injected argument

| Q | A |
|---|---|
| Feature PR | symfony/symfony#62068 |
| PR author(s) | `@yceruto` |
| Merged in | 7.4 |
| Issue | #21502 |

Fixes #21502

Update [Cursor helper](https://symfony.com/doc/current/components/console/helpers/cursor.html) docs to use injected Cursor argument.

<!--

If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/releases for the list of maintained branches).

If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `7.x` for features of unreleased versions).

-->

Commits
-------

dfcde17 [Console] Update Cursor helper to use injected argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Console Feature ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" Status: Reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants