This document describing how you can configure your IDE PhpStorm.
- Go to
Settings -> Pluginsand install next plugins:- .ignore
- Php Annotations
- Php Inspections (EA Extended)
- Php Toolbox
- JetBrains AI Assistant
- Symfony Plugin (Has some paid functions, homepage)
- Rainbow Brackets
- String Manipulation
- Go to
Settings -> Php -> Symfonyand checkEnable plugin for this projectand set Web Directory value aspublic. - If you want to control quality of your PHP project - pay your attention to the tools, described here.
You need to set a correct CLI interpreter for your PhpStorm.
In order to do it please open Settings -> PHP section and follow recommendations configuring remote PHP interpreters.
Go to Settings -> Php -> Composer and set path to composer.json, check other settings:
In order to configure PHP servers please open Settings -> PHP -> Servers.
You need to configure how your local files will be mapped inside docker container:
If you want to run tests directly from your IDE you need to do a following configuration in Settings -> PHP -> Test Frameworks:
Next you need to add Run/Debug configuration for PHP Remote Debug. It needs to be the same as image below:
In order to use Xdebug as debugging tool please follow Using Xdebug documentation.
This environment has committed .idea/ catalog, so most IDE configs should be available out of the box. But if you want to have own configs, you can put ./idea in gitignore and delete folder from the git repository.
Anyway you can always import our recommended code style if you don't have committed ./idea folder inside your repository:
- Go to
Settings -> Editor -> Code Style -> PHPand import schemeProject(CodeStyle.xml) from docs/phpstorm:
- Go to
Settings -> PHP -> Quality toolsand configure next:
Note: make sure that you have a proper local path for the PHP CS Fixer ruleset .php-cs-fixer.dist.php.
Note: make sure that you have a proper local path for the MessDetector ruleset phpmd_ruleset.xml.
- If you don't have committed folder
.idea/, go toSettings -> Editor -> Inspectionsand import profileProject Default(Inspections.xml) from docs/phpstorm:
- Go to
Settings -> Tools -> External Toolsand create ecs tool:
Note: Arguments value should be exec-bash cmd="./vendor/bin/ecs --clear-cache check $FilePathRelativeToProjectRoot$".
Note: In order to use it - right click on the necessary file/folder in PhpStorm and select context menu External Tools -> ecs.
- Go to
Settings -> Tools -> External Toolsand create phpcs tool:
Note: Arguments value should be exec-bash cmd="./vendor/bin/phpcs --version && ./vendor/bin/phpcs --standard=PSR12 --colors -p $FilePathRelativeToProjectRoot$".
Note: In order to use it - right click on the necessary file/folder in PhpStorm and select context menu External Tools -> phpcs.
For inspecting your code you can use main menu item Code -> Inspect Code. Code will be processed by code quality tools like PHP CS Fixer, PHP CodeSniffer, PHPStan, PHP Mess Detector.


















