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
Add support for @no-named-arguments
#5968
Comments
@MidnightDesign After the latest commit in 1.7.x, PHPStan now reports different result with your code snippet: @@ @@
-PHP 8.0 – 8.1 (1 error)
-==========
-
-13: Property Test::$items (array<int, string>) does not accept array<int|string, string>.
-
-PHP 7.1 – 7.4
-==========
-
No errors |
Part of the work was done already in phpstan/phpstan-src#1349 :) |
@MidnightDesign After the latest push in 1.9.x, PHPStan now reports different result with your code snippet: @@ @@
-PHP 8.0 – 8.1 (1 error)
-==========
-
-13: Property Test::$items (array<int, string>) does not accept array<int|string, string>.
-
-PHP 7.1 – 7.4
-==========
-
-No errors
+13: Property Test::$items (list<string>) does not accept array<int, string>. Full report
|
@MidnightDesign After the latest push in 1.11.x, PHPStan now reports different result with your code snippet: @@ @@
-PHP 8.0 – 8.1 (1 error)
-==========
-
-13: Property Test::$items (array<int, string>) does not accept array<int|string, string>.
-
-PHP 7.1 – 7.4
-==========
-
-No errors
+11: Constructor of class Test has a return type. Full report
|
As pointed out here #10034 (comment) the call site will currently not be validated. So neither of them raise an error: new Test(foo: "string");
new Test(...["foo" => "string"]); fyi. the bot will probably never rest as there is an actual syntax error in your example |
/cc @schlndh Hi, this is very close to what you did with named argument variants. My idea is: add Thank you for considering contributing that 😊 |
It would be great if PHPStan added support for Psalm's
@no-named-arguments
.Example use case: https://phpstan.org/r/65ac2b61-6af2-41b2-87b2-a611439210c3
The text was updated successfully, but these errors were encountered: