1 | <?php |
||
12 | abstract class AbstractCompilerPass implements CompilerPassInterface |
||
13 | { |
||
14 | const CLASS_PARAMETER = 'class'; |
||
15 | const SERVICE_PARAMETER = 'service'; |
||
16 | const NAME_PARAMETER = 'name'; |
||
17 | |||
18 | const CRITERIA_COLLECTION_PARAMETER = 'criteria_collection'; |
||
19 | const BUILDER_COLLECTION_PARAMETER = 'builder_collection'; |
||
20 | const CRITERIA_PARAMETER = 'criteria'; |
||
21 | const CONTEXT_PARAMETER = 'context'; |
||
22 | const SEARCHER_PARAMETER = 'searcher'; |
||
23 | const WRAPPER_CLASS_PARAMETER = 'wrapper_class'; |
||
24 | |||
25 | /** |
||
26 | * @var DefinitionBuilder |
||
27 | */ |
||
28 | private $definitionBuilder; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $servicePrefix; |
||
34 | |||
35 | /** |
||
36 | * @param DefinitionBuilder $definitionBuilder |
||
37 | * @param string $servicePrefix |
||
38 | */ |
||
39 | 20 | public function __construct(DefinitionBuilder $definitionBuilder, $servicePrefix) |
|
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | 19 | public function process(ContainerBuilder $container) |
|
57 | |||
58 | /** |
||
59 | * @param string $contextId |
||
60 | * @param array $context |
||
61 | * @param ContainerBuilder $container |
||
62 | */ |
||
63 | abstract protected function processContext( |
||
68 | |||
69 | /** |
||
70 | * @param string $contextId |
||
71 | * @param string $name |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | 19 | protected function buildServiceName($contextId, $name) |
|
84 | |||
85 | /** |
||
86 | * @param ContainerBuilder $container |
||
87 | * @param string $contextId |
||
88 | * @param string $definitionName |
||
89 | * @param array $config |
||
90 | * |
||
91 | * @return \Symfony\Component\DependencyInjection\Definition |
||
92 | */ |
||
93 | 19 | protected function buildDefinition( |
|
108 | |||
109 | /** |
||
110 | * @param ContainerBuilder $container |
||
111 | * @param string $contextId |
||
112 | * @param string $serviceName |
||
113 | * |
||
114 | * @return bool |
||
115 | * |
||
116 | * @throws InvalidDefinitionException |
||
117 | */ |
||
118 | 2 | protected function checkIfServiceExists( |
|
131 | } |
||
132 |