21 lines
760 B
PHP
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');
|
|
}
|
|
}
|
|
}
|