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

uopz functions are no longer using the correct signature. #5049

Closed
SMillerDev opened this issue May 20, 2021 · 4 comments
Closed

uopz functions are no longer using the correct signature. #5049

SMillerDev opened this issue May 20, 2021 · 4 comments
Labels
Milestone

Comments

@SMillerDev
Copy link

Bug report

PHPStan does not have the correct definition for uopz functions.

Code snippet that reproduces the problem

https://phpstan.org/r/5a195040-04b2-447e-a250-1a9716ded309

Expected output

according to https://github.com/krakjoe/uopz#api and my own usage of uopz, this should be valid.
phpstan/phpstan-src#482 (review) seems to have introduced this regression.

Did PHPStan help you today? Did it make you happy in any way?

PHPStan is great, this might very well be the first time I found it to be wrong 😱

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone May 20, 2021
@phpstan-bot
Copy link
Contributor

@SMillerDev After the latest commit in dev-master, PHPStan now reports different result with your code snippet:

@@ @@
-PHP 7.4 – 8.0 (1 error)
+PHP 7.4 – 8.0
 ==========
 
-3: Parameter #2 $static of function uopz_set_return expects array, Closure(): string given.
+No errors
 
 PHP 7.1 – 7.3 (1 error)
 ==========
 
 3: Syntax error, unexpected T_DOUBLE_ARROW, expecting ')' on line 3
Full report

PHP 7.4 – 8.0

No errors

PHP 7.1 – 7.3 (1 error)

Line Error
3 Syntax error, unexpected T_DOUBLE_ARROW, expecting ')' on line 3

@ondrejmirtes
Copy link
Member

Fixed by phpstan/phpstan-src@e1efa03

@SMillerDev
Copy link
Author

Thanks a lot @ondrejmirtes !

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants