Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm unable to recognize the Php File

I have a PHP trait file : app\Lib\someTrait.php

Even though it is a PHP file (with .php extension), PHPStorm is unable to recognize it as a valid PHP file. The editor is not doing syntax highlighting for PHP code inside this file and it is pretty much displayed as normal text file.

I am trying to use this file from its namespace in to another class file and there also it is unable to recognize the file path using :

use app\Lib\someTrait;

I did composer dump-autoload and also :

File->Invalid Caches and restart

I also deleted this file and restarted PHPStorm and again added it back but still not able to resolve this issue.

Looks like something has gone weird when I created a first file with this file name and now even though I tried all option PHPStorm is not treating this file as PHP file.

But still PHPStorm is unable to recognize this file.

How can I fix this issue?

like image 513
Andy Avatar asked Oct 04 '17 21:10

Andy


1 Answers

File | Settings | Editor | File Types - search for that file (someTrait.php) in a "Text" file type. Once found - remove

like image 184
Dmitrii Avatar answered Oct 04 '22 22:10

Dmitrii