PhpStorm tells me: "Namespace name doesn't match PSR 0/PSR 4 project structure"
PSR-4 namespace roots can specify a prefix which should be configured.
Here is the process:
- Find the root of your namespace e.g
src
. - right click Mark Directory as Sources Root.
- Menu -> File -> Settings -> Directories.
- Click the pencil icon or p^ next to your Sources Root.
- Enter the namespace prefix.
See PHPStorm configuring PHP namespaces
Easier than the last answers:
Go to the Settings windows: Languages & Frameworks -> PHP -> Composer and then, enable Sync IDE settings with composer.json in order to load the PSR-0 & PSR-4 set up.
PS: PhpStorm 2020.3.2 (Build #PS-203.7148.74, built on January 27, 2021)
I hope it's useful to everyone!