mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 14:25:00 +00:00
initial commit
This commit is contained in:
30
DependencyInjection/Compiler/CalculatorCompilerPass.php
Normal file
30
DependencyInjection/Compiler/CalculatorCompilerPass.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
*/
|
||||
namespace Chill\AMLI\BudgetBundle\DependencyInjection\Compiler;
|
||||
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*/
|
||||
class CalculatorCompilerPass implements CompilerPassInterface
|
||||
{
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
$manager = $container->getDefinition('Chill\AMLI\BudgetBundle\Calculator\CalculatorManager');
|
||||
|
||||
foreach ($container->findTaggedServiceIds('chill_budget.calculator') as $id => $tags) {
|
||||
foreach($tags as $tag) {
|
||||
$reference = new Reference($id);
|
||||
|
||||
$manager->addMethodCall('addCalculator', [ $reference, $tag['default'] ?? false ]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user