Skip to content

Symfony 7.3 invokable commands #9350

@OskarStark

Description

@OskarStark

Bug Report

default value is missing

Subject Details
Rector version 2.1.5

When you have the command like:

    public function configure(): void
    {
        $this
            ->addArgument('query', InputArgument::OPTIONAL, 'Query', 'wooden stove under 1000 euros');
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {}

It generates:

    public function __invoke(#[Argument(name: 'query', description: 'Query')]
        ?string $query, OutputInterface $output): int

but should:

    public function __invoke(#[Argument(name: 'query', description: 'Query')]
-        ?string $query, OutputInterface $output): int
+        string $query = 'wooden stove under 1000 euros', OutputInterface $output): int

So the default value is missing.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions