1 | <?php |
||
13 | class UserFactory implements FactoryInterface |
||
14 | { |
||
15 | public function __invoke(ContainerInterface $serviceLocator, $requestedName, array $options = null) |
||
21 | |||
22 | /** |
||
23 | * Create service |
||
24 | * |
||
25 | * @param ServiceLocatorInterface $serviceLocator |
||
26 | * @return mixed |
||
27 | */ |
||
28 | public function createService(ServiceLocatorInterface $serviceLocator) |
||
32 | } |
||
33 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.