It seems like $serviceName defined by $containerBuilder->getAlias($serviceName) on line 28 can also be of type object<Symfony\Component...endencyInjection\Alias>; however, Symfony\Component\Depend...uilder::getDefinition() does only seem to accept string, maybe add an additional type check?
If a method or function can return multiple different values and unless you are
sure that you only can receive a single value in this context, we recommend
to add an additional type check:
/** * @return array|string */functionreturnsDifferentValues($x){if($x){return'foo';}returnarray();}$x=returnsDifferentValues($y);if(is_array($x)){// $x is an array.}
If this a common case that PHP Analyzer should handle natively, please let us
know by opening an issue.
Loading history...
32
2
->setAutowiringTypes([$type]);
33
}
34
2
}
35
36
/**
37
* @return string[]
38
*/
39
2
private function getAutowireTypes(ContainerBuilder $containerBuilder)
40
{
41
2
$config = (new ConfigurationResolver())->resolveFromContainerBuilder($containerBuilder);
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.