We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 7 |
Paths | 7 |
Total Lines | 28 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function process(ContainerBuilder $container): void |
||
22 | { |
||
23 | $taggedServices = $container->findTaggedServiceIds('overblog_graphql.service', true); |
||
24 | $serviceContainer = ['container' => new Reference('service_container')]; |
||
25 | $expressionLanguageDefinition = $container->findDefinition('overblog_graphql.expression_language'); |
||
26 | |||
27 | foreach ($taggedServices as $id => $tags) { |
||
28 | foreach ($tags as $attributes) { |
||
29 | if (empty($attributes['alias']) || !is_string($attributes['alias'])) { |
||
30 | throw new InvalidArgumentException( |
||
31 | sprintf('Service "%s" tagged "overblog_graphql.service" should have a valid "alias" attribute.', $id) |
||
32 | ); |
||
33 | } |
||
34 | $serviceContainer[$attributes['alias']] = new Reference($id); |
||
35 | |||
36 | $isPublic = isset($attributes['public']) ? (bool) $attributes['public'] : true; |
||
37 | if ($isPublic) { |
||
38 | $expressionLanguageDefinition->addMethodCall( |
||
39 | 'addGlobalName', |
||
40 | [ |
||
41 | sprintf(TypeGenerator::GRAPHQL_SERVICES.'->get(\'%s\')', $attributes['alias']), |
||
42 | $attributes['alias'], |
||
43 | ] |
||
44 | ); |
||
45 | } |
||
46 | } |
||
47 | } |
||
48 | $container->findDefinition(GraphQLServices::class)->addArgument($serviceContainer); |
||
49 | } |
||
51 |