Closed acasademont closed 3 years ago
It's suggested to use the getType()
function, that now can return 2 different subclasses, https://www.php.net/manual/en/class.reflectionuniontype.php and https://www.php.net/manual/en/class.reflectionnamedtype.php.
All this is to allow union types, the parameter is now not necessarily unique. This line https://github.com/thephpleague/tactician-bundle/blob/66b97472915290b93654e60610295660f597ad4e/src/DependencyInjection/HandlerMapping/TypeHintMapping.php#L60
would also throw an error if there was a union type, as the isBuiltin()
method is only a method of the ReflectionNamedType
class (and the same with the getName()
method).
A refactor taking into account union types is needed
On PHP8 this method is deprecated
https://github.com/thephpleague/tactician-bundle/blob/66b97472915290b93654e60610295660f597ad4e/src/DependencyInjection/HandlerMapping/TypeHintMapping.php#L61
Not sure what's the best way to address it right now