Skip to content

[Console] Description of Command want's to be replaced with parameters #62763

@SiebeVE

Description

@SiebeVE

Symfony version(s) affected

^7.3|^8.0

Description

When you have a command:

#[AsCommand(name: 'description-percentage-signs', description: 'Just testing %percentage-signs%')]
class DescriptionWithPercentageSignsCommand
{
    public function __invoke(): void
    {
    }
}

The container fails to build because the description want's to be replaced with parameters which won't be found. This behaviour was changed since 7.3.

How to reproduce

Create a command with the attribute and include a string likewise to a parameter reference.

#[AsCommand(name: 'description-percentage-signs', description: 'Just testing %percentage-signs%')]
class DescriptionWithPercentageSignsCommand
{
    public function __invoke(): void
    {
    }
}

Possible Solution

Escape the description that is passed to the LazyCommand.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions