How can I automatically replace FQN in all files?
Before:
/**
* @param \app\models\Test $test
*/
After:
use app\models\Test;
/**
* @param Test $test
*/
If you have not imported that class yet (no use
statements for that class) then it's controlled by PHP | Code Style | Fully qualified name usage
inspection.
If it's already imported but you still have FQN references and want to simplify them then it's PHP | Code Style | Fully qualified name usage
inspection.
You can run Code | Inspect Code...
and apply offered fixes from there: they could be offered for 1 place only as well as for the whole thing at once (fix will be applied to the whole file or all selected files) -- not every inspection offers "batched" fix.
When doing it manually via Alt + Enter menu (or light bulb if using mouse).
Not yet imported class case:
Already imported class case: