Skip to content
Advertisement

PhpStorm unable to recognize the Php File

I have a PHP trait file : appLibsomeTrait.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 appLibsomeTrait;

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?

Advertisement

Answer

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

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement