Reputation: 66510
I upgraded from phpstorm7 to phpstorm8. Now, whenever I create a new PHP class in an existing folder, the namespace is inserted correctly. Yet when I create an empty folder and create in there a new class, the namespace is empty and I would have to manually add it.
In pictures:
How can I tell phpstorm to always autogenerate the current namespace?
Upvotes: 6
Views: 10654
Reputation: 5146
Sometimes PhpStorm doesn't correctly detect the appropriate namespace for your source directories.
You could try to fix this by going into Settings > Project: xxx > Directories
, clicking the little 'P' next to your src/
directory and setting a root namespace for your project.
(you may not have as much directories listed in the right panel, depending on the complexity of your project)
Upvotes: 10