PHPStan `@var PHPRenderer&HelperTrait` errors

I use this pattern from this example

But I get the error PHPDoc tag @var for variable $this contains unresolvable type. at level 2 or above with PHPStan.

Has anyone else encountered this problem? Does anyone have a workaround?

I decided to make a dummy class just for type hinting.

Not sure if this is a good idea (it seems kind of janky), but if anyone else has a better idea, let me know!


use Laminas\I18n\View\HelperTrait;
use Laminas\View\Renderer\PhpRenderer as LaminasPhpRenderer;

class PhpRenderer extends LaminasPhpRenderer
    use HelperTrait;