-
-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call to undefined method ReflectionUnionType::isBuiltin() #197
Comments
@glo17680 a failing test is needed |
@glo17680 the expectation is for a PHPUnit test to be provided 😁 |
@Ocramius I have attached all the required information which I have. I'm not sure for what you are asking for. Can you please confirm if any required information is missing or Is the information provided insufficient to replicate the issue ? |
@glo17680 I think it is enough. |
Note: a psalm baseline reduction would suffice. See laminas-code/psalm-baseline.xml Lines 947 to 969 in 33dd0f2
|
Bug Report
Summary
The issue is reproduced when calling detectType() with PHP8.3. The function is mentioned as Deprecated in codebase.
File: src/Reflection/ParameterReflection.php
Line:81
Error:
Current behavior
How to reproduce
Calling this function detectType() on PHP8.3 throw this error.
Expected behavior
There should be added one check if the function is not available on a particular version, the error should not be thrown.
Proposed Fix (which is working):
1-
Instead of
if (null !== ($type = $this->parameterReflection->getType()) && $type->isBuiltin()) {
we can fix by adding one check
if (null !== ($type = $this->parameterReflection->getType()) && method_exists($type, 'isBuiltin') && $type->isBuiltin()) {
2-
And instead of
if (null !== $type && $type->getName() === 'self') {
we can fix by adding one check
if (null !== $type && method_exists($type, 'getName') && $type->getName() === 'self') {
The text was updated successfully, but these errors were encountered: