question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PhpDocTagReference should not be referenced to the variables

See original GitHub issue

As result of fixing #59 PhpDocTagReference now is referenced to all PhpNamedElement offsprings which can lead to some problems (e.g. https://youtrack.jetbrains.com/issue/WI-39293, there @var is referenced to the $var), since Variable is PhpNamedElement as well.

While collecting the occurrences of the variables in introduce variable refactoring we are taking into account PsiReference::isReferenceTo, so @var is counted as reference to the variable $var. I think the easiest solution will be to change instanceof check at this line to something less general like (element instanceof PhpClass || element instanceof PhpNamespace), but I’m not deep into this code so please verify my proposal before implementing.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
cedriczielcommented, Sep 7, 2018

I have created a patch and added a test so that renaming the variable wouldn’t rename the DocTag.

0reactions
cedriczielcommented, Oct 4, 2018

I’ll upload a new release as soon as time allows. There’s a few things to be done upfront, but it should be up next week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fails to recognize import useful for PHPDoc Annotation(s ...
However PHPStorm don't check an import with alias but only if alias ... PhpDocTagReference should not be referenced to the variables #126.
Read more >
Why does passing a variable by reference not work when ...
Note: If the function has arguments that need to be references, then they must be references in the passed argument list. So, your...
Read more >
Nerdery General PHP Standards
Variable names MUST start with a lowercase letter and follow the camelCase naming convention. Variable names SHOULD only contain alphanumeric characters.
Read more >
Sublime text by John Doe - Issuu
You can tell Sublime not to show selected folders or file types in the side bar. This is convenient for hiding files that...
Read more >
Expert PHP 5 Tools
If you do not already have PHP installed on your system, you can ... Please consult the phpDoc tag reference section in this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found