@@ -128,7 +128,11 @@ public function process(ContainerBuilder $container): void
128128
129129 if ($ disableLogin === false ) {
130130 // Let's do some dark magic. We need the user provider. We need its name. It is stored in the "config" object.
131- $ provider = $ container ->findDefinition ('security.firewall.map.config. ' .$ firewallName )->getArgument (5 );
131+ $ providerConfigKey = 'security.firewall.map.config. ' .$ firewallName ;
132+ $ provider = $ container ->findDefinition ($ providerConfigKey )->getArgument (5 );
133+ if (!is_string ($ provider )){
134+ throw new GraphQLException ('Expecting to find user provider name from ' . $ providerConfigKey );
135+ }
132136
133137 $ container ->findDefinition (LoginController::class)->setArgument (0 , new Reference ($ provider ));
134138
@@ -191,6 +195,9 @@ public function process(ContainerBuilder $container): void
191195 // Let's register the mapping with UserInterface if UserInterface is available.
192196 if (interface_exists (UserInterface::class)) {
193197 $ staticTypes = $ container ->getDefinition (StaticClassListTypeMapperFactory::class)->getArgument (0 );
198+ if (!is_array ($ staticTypes )){
199+ throw new GraphQLException (sprintf ('Expecting array in %s, arg #1 ' , StaticClassListTypeMapperFactory::class));
200+ }
194201 $ staticTypes [] = SymfonyUserInterfaceType::class;
195202 $ container ->getDefinition (StaticClassListTypeMapperFactory::class)->setArgument (0 , $ staticTypes );
196203 }
@@ -294,6 +301,9 @@ private function registerController(string $controllerClassName, ContainerBuilde
294301 {
295302 $ aggregateQueryProvider = $ container ->findDefinition (AggregateControllerQueryProviderFactory::class);
296303 $ controllersList = $ aggregateQueryProvider ->getArgument (0 );
304+ if (!is_array ($ controllersList )){
305+ throw new GraphQLException (sprintf ('Expecting array in %s, arg #1 ' , AggregateControllerQueryProviderFactory::class));
306+ }
297307 $ controllersList [] = $ controllerClassName ;
298308 $ aggregateQueryProvider ->setArgument (0 , $ controllersList );
299309 }
@@ -336,7 +346,14 @@ private function makePublicInjectedServices(ReflectionClass $refClass, Annotatio
336346 return $ services ;
337347 });
338348
349+ if (!is_array ($ services )){
350+ throw new GraphQLException ('An error occurred in compiler pass ' );
351+ }
352+
339353 foreach ($ services as $ service ) {
354+ if (!is_string ($ service )){
355+ throw new GraphQLException ('expecting string as service ' );
356+ }
340357 if ($ container ->hasAlias ($ service )) {
341358 $ container ->getAlias ($ service )->setPublic (true );
342359 } else {
0 commit comments