$eventArgs->getClassMetadata() of type object<Doctrine\Common\P...\Mapping\ClassMetadata> is not a sub-type of object<Doctrine\ORM\Mapping\ClassMetadata>. It seems like you assume a concrete implementation of the interface Doctrine\Common\Persistence\Mapping\ClassMetadata to be always present.
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.
Loading history...
39
}
40
41
/**
42
* @param ClassMetadata $metadata
43
*/
44
private function setCustomRepositoryClass(ClassMetadata $metadata)
It seems like $resourceMetadata->getClass('repository') targeting Sylius\Component\Resourc...taInterface::getClass() can also be of type array; however, Doctrine\ORM\Mapping\Cla...CustomRepositoryClass() does only seem to accept string, maybe add an additional type check?
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
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.