Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| ApieBundle | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
| registerCommands | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
| build | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\ApieBundle; |
| 3 | |
| 4 | use Apie\ApieBundle\DependencyInjection\Compiler\AutoTagActionsCompilerPass; |
| 5 | use Apie\Common\Wrappers\ConsoleCommandFactory; |
| 6 | use Symfony\Component\Console\Application; |
| 7 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
| 8 | use Symfony\Component\HttpKernel\Bundle\Bundle; |
| 9 | |
| 10 | final class ApieBundle extends Bundle |
| 11 | { |
| 12 | public function registerCommands(Application $application): void |
| 13 | { |
| 14 | if ($this->container->has('apie.console.factory')) { |
| 15 | /** @var ConsoleCommandFactory $factory */ |
| 16 | $factory = $this->container->get('apie.console.factory'); |
| 17 | $application->addCommands(iterator_to_array($factory->create($application))); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | public function build(ContainerBuilder $container): void |
| 22 | { |
| 23 | $container->addCompilerPass(new AutoTagActionsCompilerPass()); |
| 24 | } |
| 25 | } |