There are two classes defined as follows:
class Foo
{
private $aaa;
public function setAaa(Aaa $aaa): self
{
$this->aaa = $aaa;
return $this;
}
}
class Bar extends Foo
{
private $bbb;
public function setBbb(Bbb $bbb): self
{
$this->bbb = $bbb;
return $this;
}
}
So here "fluent" setters are used. But PhpStorm seems to ignore this and displays a warning:
$bar = (new Bar())
->setAaa(new Aaa())
->setAaa(new Bbb())
;
Method 'setBbb' not found in ...\Foo
Is there a way to get the autocompletion working as expected ins such cases?