$property of type object<Reflector> is not a sub-type of object<ReflectionProperty>. It seems like you assume a concrete implementation of the interface Reflector 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...
25
}
26
27
/**
28
* @param \ReflectionProperty $property
29
* @return string
30
*/
31
4
protected static function doGenerate(\ReflectionProperty $property): string
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.