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
@phpstan-ignore-line do not work in chained setters #4250
Comments
Reported upstream: nikic/PHP-Parser#742 |
also, call to undefined method warning is rendered with wrong line: https://phpstan.org/r/b4bd2d03-7465-4b32-b731-895522112f57 quite important as chanined method calls are very often on separate lines |
I have a similar issue with function arguments: function sayHello(DateTimeInterface $date): void {}
sayHello(
new stdClass /* @phpstan-ignore-line */
);
sayHello(
/* @phpstan-ignore-line */ new stdClass
); Only the second error is suppressed: https://phpstan.org/r/f19a1c5d-44eb-4f25-bb44-b5126fe29b0a I would guess this is related? |
@Eimantas123 After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
+ 7: Property AwesomeFeature::$variable is never read, only written.
35: Parameter #1 $variable of method AwesomeFeature::setVariable() expects string, string|null given. Full report
|
@mvorisek After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
+ 7: Property AwesomeFeature::$variable is never read, only written.
34: Call to an undefined method AwesomeFeature::doSmthd().
35: Parameter #1 $variable of method AwesomeFeature::setVariable() expects string, string|null given. Full report
|
@Eimantas123 After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
+ 7: Property AwesomeFeature::$variable is never read, only written.
35: Parameter #1 $variable of method AwesomeFeature::setVariable() expects string, string|null given. Full report
|
@mvorisek After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
+ 7: Property AwesomeFeature::$variable is never read, only written.
34: Call to an undefined method AwesomeFeature::doSmthd().
35: Parameter #1 $variable of method AwesomeFeature::setVariable() expects string, string|null given. Full report
|
@Eimantas123 After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-35: Parameter #1 $variable of method AwesomeFeature::setVariable() expects string, string|null given.
+ 7: Property AwesomeFeature::$variable is never read, only written. Full report
|
@mvorisek After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-34: Call to an undefined method AwesomeFeature::doSmthd().
-35: Parameter #1 $variable of method AwesomeFeature::setVariable() expects string, string|null given.
+ 7: Property AwesomeFeature::$variable is never read, only written.
+34: Call to an undefined method AwesomeFeature::doSmthd(). Full report
|
@digilist After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-6: Parameter #1 $date of function sayHello expects DateTimeInterface, stdClass given.
+No errors |
Fixed: phpstan/phpstan-src@9474696 |
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. |
The text was updated successfully, but these errors were encountered: