mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-21 22:24:59 +00:00
33 lines
1011 B
PHP
33 lines
1011 B
PHP
<?php
|
|
|
|
/**
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Chill\AMLI\BudgetBundle\DependencyInjection\Compiler;
|
|
|
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
use Symfony\Component\DependencyInjection\Reference;
|
|
|
|
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]);
|
|
}
|
|
}
|
|
}
|
|
}
|