Fix PhpStorm Not Detecting Correct Namespace For New Files

February 19 2015, 2:57pm

Go to Preferences > Directories, click on the folder with the wrong directory, then click the blue "Sources" button above to mark it as a source root, then click the little "P" icon beside it in the right panel and you can put in what the namespace of that folder should start. In the example they mark any files under the "src" folder to start with the namespace "JetBrains\Wordpress\NetworkMarketing".

enter image description here