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() and array type hinting inside closure #4906
Comments
@mente After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
+10: Property Connection::$params is unused.
+18: Property HelloWorld::$connectionParameters is never written, only read.
+20: Method HelloWorld::overrideConnectionParameters() is unused.
24: Array (array<string, mixed>) does not accept key (int|string). Full report
|
@mente After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-24: Array (array<string, mixed>) does not accept key (int|string).
+10: Property Connection::$params is unused.
+24: Array (array<string, mixed>) does not accept key (int|string).
+18: Property HelloWorld::$connectionParameters is never written, only read.
+20: Method HelloWorld::overrideConnectionParameters() is unused. Full report
|
@mente After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-24: Array (array<string, mixed>) does not accept key (int|string).
+10: Property Connection::$params is unused.
+18: Property HelloWorld::$connectionParameters is never written, only read.
+20: Method HelloWorld::overrideConnectionParameters() is unused. Full report
|
Nice, looks like fixed, so closing |
Closes phpstan/phpstan#4906 Closes phpstan/phpstan#4165 Closes phpstan/phpstan#4910 Closes phpstan/phpstan#3703
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
With latest upgrade to 0.12.84 (by probably fixing #4808) PHPStan loses the typing of an array coming from an upper class.
Code snippet that reproduces the problem
https://phpstan.org/r/d4e5e3e8-57f6-4f1b-88e6-cfcd73e8c8ef
Expected output
No errors reports.
PS Simple type hinting of
$connectionParameters
insideClosure:bind
would have helped, but fixing type erasure will be a proper solution.The text was updated successfully, but these errors were encountered: