How to get the class for some $var (PhpStorm)

Hi ! I need to get the class name for some PsiElement (Variable).
I was trying something like.

            PhpType phpType = variable.getType();
            String signature = phpType.toString();
            PhpIndex index = PhpIndex.getInstance(currentElement.getProject());
            Collection<PhpNamedElement> classes = index.getBySignature(signature);


But "classes" is always returning 0 elements, could somebody help me with this?
Thanks !!

3 comments

It doesn't work either. Inside "signature" I have something like: #ÑMODEL.sales/quote|?

0

Enrique, you got my Skype - feel free to discuss openapi problems there.
This is so way off any context.

0

Please sign in to leave a comment.