简体   繁体   中英

PhpStorm does not highlight unimported classes

I'm using PhpStorm 2016.2 and recently I've noticed that it has stopped highlighting errors when a class is not imported from any namespace.

Let's say a namespaced class and inside I have a call like this:

$user = User::findOne(123);

In order for the above to work, I would need to do use common\\models\\User . But there is no error highlight and if I try to execute the code, it would of course fail. I'm confident that previously I got such errors highlighted. I'm not sure however when that happened - since update to 2016.2 or after doing something unintended.

You can follow the below steps to highlight the undefined/unimported class in phpstorm.

  1. Go to preferences tab, choose inspections from Editor.
  2. From the lists, choose php.
  3. Under that, tick the Undefined class and click Apply and Ok.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM