Files
kupshop/bundles/External/PompoBundle/DependencyInjection/Compiler/UnregisterUnwantedServicesPass.php
2025-08-02 16:30:27 +02:00

21 lines
760 B
PHP

<?php
declare(strict_types=1);
namespace External\PompoBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class UnregisterUnwantedServicesPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
// kvuli nejhracce, ktera nema bonus program, ale ma vratky, takze to zacne loadovat predefinovany bonus computer
// a padne to na dalsich dependencich, takze to proste v pripade chybejiciho modulu odeberu a je to :)
if (!findModule(\Modules::BONUS_PROGRAM)) {
$container->removeDefinition('KupShop\BonusProgramBundle\Utils\BonusComputer');
}
}
}