I do hope this is not a duplicate; I searched but think I did not report this in the past.
Consider this code:
class HelloWorld
{
public function foo() : void
{
}
public function bar() : void
{
$this->foo(123);
}
}
Here, calling foo
with parameter "123" is wrong, because foo
accepts zero parameters.
PHPStan correctly reports this:
Method HelloWorld::foo() invoked with 1 parameter, 0 required.
PHP Tools currently does not notify me about it.
Suggestion
Please also warn me if I call a zero-parameter method with parameter(s).