This repository was archived by the owner on Feb 5, 2021. It is now read-only.
File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,13 @@ public function process(ContainerBuilder $container): void
98
98
$ this ->crossContainerProcessor ->process ($ scenarioContainer );
99
99
}
100
100
101
+ // This feature was introduced only in symfony/dependency-injection v3.3
102
+ // So we are adding the feature for modern containers and leaving as-is for older ones
103
+ if (method_exists ($ scenarioContainer , 'registerForAutoconfiguration ' )) {
104
+ $ scenarioContainer ->registerForAutoconfiguration (\Behat \Behat \Context \Context::class)
105
+ ->addTag (ContextRegistryPass::CONTEXT_SERVICE_TAG );
106
+ }
107
+
101
108
$ scenarioContainer ->addCompilerPass (new ContextRegistryPass ($ container ->getDefinition ('fob_context_service.context_registry ' )));
102
109
$ scenarioContainer ->compile ();
103
110
}
Original file line number Diff line number Diff line change 22
22
*/
23
23
final class ContextRegistryPass implements CompilerPassInterface
24
24
{
25
+ const CONTEXT_SERVICE_TAG = 'fob.context_service ' ;
26
+
25
27
/**
26
28
* @var Definition
27
29
*/
@@ -40,7 +42,7 @@ public function __construct(Definition $contextRegistryDefinition)
40
42
*/
41
43
public function process (ContainerBuilder $ container ): void
42
44
{
43
- $ taggedServices = $ container ->findTaggedServiceIds (' fob.context_service ' );
45
+ $ taggedServices = $ container ->findTaggedServiceIds (self :: CONTEXT_SERVICE_TAG );
44
46
45
47
foreach ($ taggedServices as $ id => $ tags ) {
46
48
$ this ->contextRegistryDefinition ->addMethodCall (
You can’t perform that action at this time.
0 commit comments