@@ -128,7 +128,11 @@ public function process(ContainerBuilder $container): void
128
128
129
129
if ($ disableLogin === false ) {
130
130
// 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
+ }
132
136
133
137
$ container ->findDefinition (LoginController::class)->setArgument (0 , new Reference ($ provider ));
134
138
@@ -191,6 +195,9 @@ public function process(ContainerBuilder $container): void
191
195
// Let's register the mapping with UserInterface if UserInterface is available.
192
196
if (interface_exists (UserInterface::class)) {
193
197
$ 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
+ }
194
201
$ staticTypes [] = SymfonyUserInterfaceType::class;
195
202
$ container ->getDefinition (StaticClassListTypeMapperFactory::class)->setArgument (0 , $ staticTypes );
196
203
}
@@ -294,6 +301,9 @@ private function registerController(string $controllerClassName, ContainerBuilde
294
301
{
295
302
$ aggregateQueryProvider = $ container ->findDefinition (AggregateControllerQueryProviderFactory::class);
296
303
$ controllersList = $ aggregateQueryProvider ->getArgument (0 );
304
+ if (!is_array ($ controllersList )){
305
+ throw new GraphQLException (sprintf ('Expecting array in %s, arg #1 ' , AggregateControllerQueryProviderFactory::class));
306
+ }
297
307
$ controllersList [] = $ controllerClassName ;
298
308
$ aggregateQueryProvider ->setArgument (0 , $ controllersList );
299
309
}
@@ -336,7 +346,14 @@ private function makePublicInjectedServices(ReflectionClass $refClass, Annotatio
336
346
return $ services ;
337
347
});
338
348
349
+ if (!is_array ($ services )){
350
+ throw new GraphQLException ('An error occurred in compiler pass ' );
351
+ }
352
+
339
353
foreach ($ services as $ service ) {
354
+ if (!is_string ($ service )){
355
+ throw new GraphQLException ('expecting string as service ' );
356
+ }
340
357
if ($ container ->hasAlias ($ service )) {
341
358
$ container ->getAlias ($ service )->setPublic (true );
342
359
} else {
0 commit comments