I have a PHP file for the class definition and a separate HTML/PHP file for the template. The template file is included inside the class with an ordinary PHP include. Because of this, all $this references inside the template file are valid, but I can't figure out how to tell PHPStorm this. I've tried typehinting in the template file, but it still complains about protected access. I've managed to get around the problem for class properties by adding @property annotations in the class' PHPDoc, but I'm still having problems with methods.
Usually I don't include templates with plain includes, but this is a special class which must have simple logic, and not a complex templating engine.
But I think there shoud be an exception if the typehinted variable is $this which would ignore access levels since $this is a special variable. And I don't like those @property annotations because they sould be redundant in this case.
Has anyone else come across this problem? How did you solve it?