Get PhpStorm to find references
Hi
New to PHP and PhpStorm
I am using Phpstorm to write code sniffs based on phpcs,
I my code I reference the code sniffing classes like this
\PHP_CodeSniffer_Tokens::$emptyTokens
When I try to go to the referecne of $emptyTokens Phpstorm cannot find it.
Is there a way of getting Phpstorm to find such references?
Thanks
Please sign in to leave a comment.
Do you have PHP_CodeSniffer_Tokens class in your project and you can navigate to it by ctrl+clicking it? Do you have $emptyTokens there?
Hi thanks for your reply
PHP_CodeSniffer_Tokens exists in a different folder to my project, so does nit form part of it. I am unable to ctrl+click to it.
I also have a related problem with files that are part of my project.
The code completion does not pick up data members in a base class but in this case I am able to ctrl+click
You need to include `PHP_CodeSniffer_Tokens` into a project (e.g. by adding necessary files in "Include path" at File | Settings | Languages & Frameworks | PHP) for IDE to recognize those classes, methods and constants.
I have now added the path to PHP_CodeSniffer_Tokens and can ctrl+click to it
However code completion still does not work