Total Complexity | 7 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class EnterpriseFilterStubPass implements CompilerPassInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $type; |
||
15 | |||
16 | /** |
||
17 | * @param string $type |
||
18 | */ |
||
19 | public function __construct(string $type) |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * {@inheritdoc} |
||
26 | */ |
||
27 | public function process(ContainerBuilder $container) |
||
28 | { |
||
29 | $registry = $container->getDefinition(sprintf('pimee_workflow.query.filter.%s_registry', $this->type)); |
||
30 | $filterTag = sprintf('pimee_workflow.elasticsearch.query.%s_filter', $this->type); |
||
31 | |||
32 | $filters = $this->findTaggedServices($filterTag, $container); |
||
33 | foreach ($filters as $filter) { |
||
34 | $registry->addMethodCall('register', [$filter]); |
||
35 | } |
||
36 | } |
||
37 | |||
38 | private function findTaggedServices(string $tagName, ContainerBuilder $container): array |
||
52 | } |
||
53 | } |
||
54 |