Search code examples
phpstorm

PhpStorm. Auto import namespaces by comma not by "use"


Can I auto import namespaces in PhpStorm like this way?

use Foo/Bar,
    Foo/Bar2,
    Foo2/Bar;

Not like this:

use Foo/Bar;
use Foo/Bar2;
use Foo2/Bar;

Solution

  • Not possible automatically yet: https://youtrack.jetbrains.com/issue/WI-15876. You can use Alt/Cmd+Enter though and do that manually (group use statements... PHP intention at File | Settings | Editor | Intentions):

    Group use statements by selected prefix