| @@ 17-37 (lines=21) @@ | ||
| 14 | * |
|
| 15 | * @codingStandardsIgnoreFile |
|
| 16 | */ |
|
| 17 | class CommitMsg extends Application |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * @var AppKernel |
|
| 21 | */ |
|
| 22 | private $container; |
|
| 23 | ||
| 24 | public function __construct() |
|
| 25 | { |
|
| 26 | $appKernel = new AppKernel('dev', true); |
|
| 27 | $appKernel->boot(); |
|
| 28 | $this->container = $appKernel->getContainer(); |
|
| 29 | parent::__construct('commit-msg'); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function doRun(InputInterface $input, OutputInterface $output) |
|
| 33 | { |
|
| 34 | $this->container->get('bruli.command.bus') |
|
| 35 | ->handle(new \PhpGitHooks\Module\Git\Contract\Command\CommitMsg($input)); |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||
| @@ 19-45 (lines=27) @@ | ||
| 16 | * |
|
| 17 | * @codingStandardsIgnoreFile |
|
| 18 | */ |
|
| 19 | class PreCommit extends Application |
|
| 20 | { |
|
| 21 | /** |
|
| 22 | * @var AppKernel |
|
| 23 | */ |
|
| 24 | private $container; |
|
| 25 | ||
| 26 | /** |
|
| 27 | * PreCommit constructor. |
|
| 28 | */ |
|
| 29 | public function __construct() |
|
| 30 | { |
|
| 31 | $appKernel = new AppKernel('dev', true); |
|
| 32 | $appKernel->boot(); |
|
| 33 | $this->container = $appKernel->getContainer(); |
|
| 34 | parent::__construct('pre-commit'); |
|
| 35 | } |
|
| 36 | ||
| 37 | public function doRun(InputInterface $input, OutputInterface $output) |
|
| 38 | { |
|
| 39 | /** |
|
| 40 | * @var PreCommitToolCommandHandler |
|
| 41 | */ |
|
| 42 | $command = $this->container->get('bruli.command.bus'); |
|
| 43 | $command->handle(new PreCommitTool()); |
|
| 44 | } |
|
| 45 | } |
|
| 46 | ||