diff --git a/src/Commands/Check.php b/src/Commands/Check.php index e2cd357..4cd4343 100644 --- a/src/Commands/Check.php +++ b/src/Commands/Check.php @@ -14,14 +14,16 @@ use Khalyomede\PhpTypo\Exceptions\FolderScanException; use Khalyomede\PhpTypo\Exceptions\NotAFileException; use Khalyomede\PhpTypo\Exceptions\WordsFileInvalidJsonFormatException; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand( + name: "check" +)] final class Check extends Command { - protected static $defaultName = "check"; - protected function execute(InputInterface $input, OutputInterface $output): int { try { diff --git a/src/Commands/Init.php b/src/Commands/Init.php index 9276800..c64c583 100644 --- a/src/Commands/Init.php +++ b/src/Commands/Init.php @@ -6,14 +6,16 @@ use Khalyomede\PhpTypo\Config; use Khalyomede\PhpTypo\Exceptions\ConfigWriteException; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand( + name: "init", +)] final class Init extends Command { - protected static $defaultName = "init"; - protected function execute(InputInterface $input, OutputInterface $output): int { if (Config::exists()) {