File tree 1 file changed +12
-4
lines changed
src/Bundle/JoseFramework/Resources/config
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 14
14
use Jose \Component \KeyManagement ;
15
15
use Symfony \Component \DependencyInjection \Loader \Configurator \ContainerConfigurator ;
16
16
use function Symfony \Component \DependencyInjection \Loader \Configurator \ref ;
17
+ use Symfony \Component \DependencyInjection \Loader \Configurator \ReferenceConfigurator ;
18
+ use function Symfony \Component \DependencyInjection \Loader \Configurator \service ;
17
19
18
20
return function (ContainerConfigurator $ container ): void {
19
21
$ container = $ container ->services ()->defaults ()
22
24
->autowire ()
23
25
;
24
26
27
+ $ serviceClosure = static function (string $ serviceId ): ReferenceConfigurator {
28
+ return function_exists ('Symfony\Component\DependencyInjection\Loader\Configurator\service ' )
29
+ ? service ($ serviceId )
30
+ : ref ($ serviceId );
31
+ };
32
+
25
33
$ container ->set (KeyManagement \JKUFactory::class)
26
34
->public ()
27
35
->args ([
28
- ref ('jose.http_client ' ),
29
- ref ('jose.request_factory ' ),
36
+ ( $ serviceClosure ) ('jose.http_client ' ),
37
+ ( $ serviceClosure ) ('jose.request_factory ' ),
30
38
])
31
39
;
32
40
33
41
$ container ->set (KeyManagement \X5UFactory::class)
34
42
->public ()
35
43
->args ([
36
- ref ('jose.http_client ' ),
37
- ref ('jose.request_factory ' ),
44
+ ( $ serviceClosure ) ('jose.http_client ' ),
45
+ ( $ serviceClosure ) ('jose.request_factory ' ),
38
46
])
39
47
;
40
48
};
You can’t perform that action at this time.
0 commit comments