|
6 | 6 |
|
7 | 7 | use GrumPHP\Collection\FilesCollection; |
8 | 8 | use GrumPHP\Collection\TestSuiteCollection; |
9 | | -use GrumPHP\IO\IOFactory; |
10 | 9 | use GrumPHP\IO\IOInterface; |
11 | 10 | use GrumPHP\Locator\ChangedFiles; |
12 | 11 | use GrumPHP\Locator\StdInFiles; |
|
16 | 15 | use GrumPHP\Util\Filesystem; |
17 | 16 | use GrumPHP\Util\Paths; |
18 | 17 | use SplFileInfo; |
| 18 | +use Symfony\Component\Console\Attribute\AsCommand; |
19 | 19 | use Symfony\Component\Console\Command\Command; |
20 | 20 | use Symfony\Component\Console\Input\InputArgument; |
21 | 21 | use Symfony\Component\Console\Input\InputInterface; |
|
25 | 25 | /** |
26 | 26 | * This command runs the git commit-msg hook. |
27 | 27 | */ |
| 28 | +#[AsCommand(name: 'git:commit-msg', description: 'Executed by the commit-msg commit hook')] |
28 | 29 | class CommitMsgCommand extends Command |
29 | 30 | { |
30 | | - const COMMAND_NAME = 'git:commit-msg'; |
31 | 31 | const EXIT_CODE_OK = 0; |
32 | 32 | const EXIT_CODE_NOK = 1; |
33 | 33 |
|
@@ -83,14 +83,8 @@ public function __construct( |
83 | 83 | $this->io = $io; |
84 | 84 | } |
85 | 85 |
|
86 | | - public static function getDefaultName(): string |
87 | | - { |
88 | | - return self::COMMAND_NAME; |
89 | | - } |
90 | | - |
91 | 86 | protected function configure(): void |
92 | 87 | { |
93 | | - $this->setDescription('Executed by the commit-msg commit hook'); |
94 | 88 | $this->addOption('git-user', null, InputOption::VALUE_REQUIRED, 'The configured git user name.', ''); |
95 | 89 | $this->addOption('git-email', null, InputOption::VALUE_REQUIRED, 'The configured git email.', ''); |
96 | 90 | $this->addArgument('commit-msg-file', InputArgument::REQUIRED, 'The configured commit message file.'); |
|
0 commit comments