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
Closure::bind
must honor class-string<>
#4949
Comments
Should be fixed here: https://github.com/phpstan/phpstan-src/blob/7b301a1850e7dcb2455c0f319671f370e16eec66/src/Analyser/NodeScopeResolver.php#L2060-L2080 The condition with ClassConstFetch could be removed imho. |
@mvorisek After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-24: Call to protected method getHintableProps() of class Model.
+ 9: Method Model::getHintableProps() should return X but return statement is missing.
+20: Method HelloWorld::sayHello() should return X but return statement is missing. Full report
|
@mvorisek After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
PHP 7.1 – 7.3 (4 errors)
==========
-17: Syntax error, unexpected ')' on line 17
+17: Syntax error, unexpected T_STRING, expecting T_PAAMAYIM_NEKUDOTAYIM on line 17
+17: Syntax error, unexpected T_DOUBLE_ARROW on line 17
17: Syntax error, unexpected ',' on line 17
-17: Syntax error, unexpected T_DOUBLE_ARROW on line 17
-17: Syntax error, unexpected T_STRING, expecting T_PAAMAYIM_NEKUDOTAYIM on line 17
+17: Syntax error, unexpected ')' on line 17 Full reportPHP 7.4 – 8.0 (1 error)
PHP 7.1 – 7.3 (4 errors)
|
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. |
Bug report
Closure::bind
must honorclass-string<>
Code snippet that reproduces the problem
see https://phpstan.org/r/adaa989d-186d-4111-80df-b56afcf1fb0f
and https://phpstan.org/r/86a890d6-a041-4f1a-83ca-a5a777002971
https://3v4l.org/KQo6c works
Expected output
no error
The text was updated successfully, but these errors were encountered: