-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Milestone
Description
Summary of problem
The rule: "Result of method {xxx} (void) is used" should IMO check that the result of a void method is actually used, i.e. set to a variable or passed to a function/method...
However it does not seems to work like that.
Code snippet that reproduces the problem
class HelloWorld {
public function test(): void {
return;
}
public function testVoidResult(): void {
// this does not use the return value of `test()`, still it is reported
true or $this->test();
}
}https://phpstan.org/r/dea43fe8-b309-491b-bdde-b06bfcbaed88
Expected output
I would expect the rule to report an error only if the void return is actually used.
Reactions are currently unavailable