Automatically adding use statements for root PHP classes/exceptions

Hi.

I don't know what setting I changed, but when I save PHP files, PHPStorm automatically adds use statements for some root PHP classes. For example, if I have `\Exception` in the code it adds the use and replaces it with `Exception`. 

For example, in a huge file I get imported the following:

use function count;
use function func_get_args;
use function in_array;
use function is_array;
use function is_string;
use function strlen;

This is annoying, mainly because it clashes with the company PHP CS Fixer setting, so I always waste a lot of time managing this.

I tried disabling Editor > General > Auto Import > PHP, but everything seems correct.

 

Any suggestion?

Thanks!

0
1 comment

Hi maxxer,

Could you please share the file in question for further investigation? It can be uploaded here: https://uploads.jetbrains.com/. Just let us know the upload ID in the next reply.

0

Please sign in to leave a comment.