This PR resolves a phpstan error when using PHP >= 8.0, php version used: PHP 8.0.19 (cli).
The error:
------ ----------------------------------------------------------
Line Parameter.php
------ ----------------------------------------------------------
88 Call to an undefined method ReflectionType::isBuiltin().
------ ----------------------------------------------------------
The error message originated in the Parameter::isBuiltin() at L#88 because it is possible that a ReflectionParameter::class object is passed to the constructor that has a type, but is of the type: ReflectionUnionType::class in PHP 8.0 or ReflectionIntersectionType::class in PHP 8.1 and up.
To test this behavior, two dummy classes are added within the test namespace, one containing a union type, the other an intersection type, both tested for their respective versions of PHP.
Please let me know what you think of the suggested additions!
Description
This PR resolves a phpstan error when using PHP >= 8.0, php version used:
PHP 8.0.19 (cli)
. The error:The error message originated in the
Parameter::isBuiltin()
at L#88 because it is possible that aReflectionParameter::class
object is passed to the constructor that has a type, but is of the type: ReflectionUnionType::class in PHP 8.0 or ReflectionIntersectionType::class in PHP 8.1 and up.To test this behavior, two dummy classes are added within the test namespace, one containing a union type, the other an intersection type, both tested for their respective versions of PHP.
Please let me know what you think of the suggested additions!