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?
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With