Symfony version(s) affected
7.4.0
Description
Before 7.4.0 calling the setAliases function before parent::__construct on a custom Command was working, now aliases are not defined when doing this.
I'm not sure such thing is in the BC policy ? Close it if not.
How to reproduce
Having a command like this
class MyCommand extends Command
{
public function __construct()
{
$this->setAliases(['alias']);
parent::__construct('my-command');
}
}
Possible Solution
Alias should be declared after parent :
class MyCommand extends Command
{
public function __construct()
{
parent::__construct('my-command');
$this->setAliases(['alias']);
}
}
Additional Context
No response