DanVeira
DanVeira

Reputation: 371

Undefined constant Traits in PhpStorm 2016.2.1

I am developing with Laravel 5.3 and everything works fine but PhpStorm keeps squawking at the namespace every time I use "Traits", like this:

Print Screen

Please note that the code works fine, no errors whatsoever so I'm guessing this is a PhpStorm's issue.

Upvotes: 2

Views: 1134

Answers (1)

LazyOne
LazyOne

Reputation: 165178

This looks like Parser issue -- happens when namespace contains words that are similar to PHP keywords (Traits in your case).

Things you can try:

  • Cutting whole text into clipboard and then pasting it back.
  • If still the same -- try Code | Inspect Code... and run it on this file only.
  • If still nothing -- try restarting IDE.

Other than that -- https://youtrack.jetbrains.com/issue/WI-5015 -- watch this ticket (star/vote/comment) to get notified on proper fix.

Upvotes: 3

Related Questions