vscode-intelephense icon indicating copy to clipboard operation
vscode-intelephense copied to clipboard

Annotate class member insed a function scope

Open hakito opened this issue 1 year ago • 1 comments

Feature description or problem with existing feature I am using CakePHP. When I work with a template file I am in a function like scope and have for example access to the form helper with $this->Form

Describe the solution you'd like I'd like to be able to annotate the type of Form. I tried it with

use Cake\View\Helper\FormHelper;
/** @var FormHelper $this->Form */
/** @property FormHelper $Form */

But none of them worked.

hakito avatar Feb 01 '24 07:02 hakito

Does adding the below to the template file work?

/** @var \Cake\View\View $this **/

bmewburn avatar Feb 17 '24 06:02 bmewburn

Yes that does the trick - thanks!

hakito avatar Feb 19 '24 07:02 hakito