Use annotations and autoconfiguration

Use the `AsCommand` annotation to automatically register commands as
services and automatically add them to `./bin/console` instead of adding
them manually.
This commit is contained in:
Oliver Davies 2024-02-26 20:40:58 +00:00
parent bfc9a89842
commit 4ebfd9333a
17 changed files with 78 additions and 81 deletions

View file

@ -8,8 +8,6 @@ use Symfony\Component\Filesystem\Filesystem;
abstract class AbstractCommand extends Command
{
protected static string $description;
public function __construct(
protected Filesystem $filesystem,
?string $name = null,
@ -19,8 +17,6 @@ abstract class AbstractCommand extends Command
protected function configure(): void
{
$this->setDescription(static::$description);
$this->addOption(
name: 'args',
shortcut: 'a',