mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-11-12 21:28:45 +00:00
Start using Symfony Components
This commit is contained in:
parent
b61178b9b0
commit
bc3dae9c48
9 changed files with 131 additions and 13 deletions
22
src/Container/CommandCompilerClass.php
Normal file
22
src/Container/CommandCompilerClass.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace Opdavies\GmailFilterBuilder\Container;
|
||||
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
|
||||
class CommandCompilerClass implements CompilerPassInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function process(ContainerBuilder $container) {
|
||||
$definition = $container->findDefinition('app.cli');
|
||||
$taggedServices = $container->findTaggedServiceIds('ConsoleCommand');
|
||||
|
||||
foreach ($taggedServices as $id => $tags) {
|
||||
$definition->addMethodCall('add', [new Reference($id)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue