Skip to content
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

There is no @return existence check when prototyping #52

Open
sd1328 opened this issue Nov 26, 2020 · 1 comment
Open

There is no @return existence check when prototyping #52

sd1328 opened this issue Nov 26, 2020 · 1 comment
Labels
Bug Something isn't working

Comments

@sd1328
Copy link

sd1328 commented Nov 26, 2020

Insufficient return value validation

Class \Laminas\Code\Reflection\MethodReflection
Method: getPrototype
Line: 100

if ($docBlock) {
            $return = $docBlock->getTag('return');
            $returnTypes = $return->getTypes();   // return false
            $returnType = count($returnTypes) > 1 ? implode('|', $returnTypes) : $returnTypes[0];
}

There is no check for the existence of @return. If it is absent, we get an exception "Call to a member function getTypes() on bool"

@sd1328 sd1328 added the Bug Something isn't working label Nov 26, 2020
@fezfez
Copy link
Contributor

fezfez commented Dec 1, 2020

@sd1328 : please provide a code to reproducing the bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants