Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
20 | public function process(ContainerBuilder $container) |
||
21 | { |
||
22 | $config = $container->getParameter('graphql.graphiql'); |
||
23 | $providerId = $container->getParameter('graphql.graphiql_auth_provider'); |
||
24 | $provider = null; |
||
25 | |||
26 | if ($providerId) { |
||
27 | $provider = $container->getDefinition($providerId); |
||
28 | } elseif ($config['authentication']['required']) { |
||
29 | throw new \RuntimeException('Configure a valid provider to use GraphiQL with authentication.'); |
||
30 | } |
||
31 | |||
32 | $controllerDefinition = $container->getDefinition(ExplorerController::class); |
||
33 | $controllerDefinition->setArgument(1, $provider); |
||
34 | } |
||
36 |