This document describing how you can configure your IDE PhpStorm.
- Go to
Settings -> Plugins
and install next plugins:- .env files support
- .ignore
- Makefile Language
- Laravel
- Php Inspections (EA Extended)
- Rainbow brackets
- String Manipulation
- Extra ToolWindow Colorful Icons
- Go to
Settings -> Php -> Laravel
and checkEnable plugin for this project
. - If you want control quality of your project - pay your attention to tools, described here and
Qodana
tool.
You need to set 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 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.
- Go to
Settings -> Editor -> Code Style
and import schemeSystemsdk
(CodeStyle.xml) from docs/phpstorm:
- Go to
Settings -> PHP -> Quality tools
and configure next:
- Set other configurations for code quality tools and make sure that you have proper path for the MessDetector ruleset
phpmd_ruleset.xml
:
- Go to
Settings -> Editor -> Inspections
and import profileSystemsdk
(Inspections.xml) from docs/phpstorm:
- Go to
Settings -> Tools -> External tools
and 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 tools
and 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 Mess Detector, PHP CodeSniffer, PHPStan.