Configure Xdebug
Install web browser xdebug activation:
Configure PhpStorm for Xdebug
Configure Tools
Configure Docker usage
Open PhpStorm preferences:
- Go to Build, Execution, Deployment section. Then go to Docker subsection
- Create new docker
- Rename this docker
- Set connection type to Docker
- configure path mapping between docker machine and local path
Configure Tool access to docker :
Configure Tools for docker
Configure Cli interpreter
- Open PhpStorm Preferences, then go to section PHP then go to the subsection Composer.
- Set path to
compser.json
file - Set Execution on remote docker
- Set or create cli interpreter
Configure Test framework
PhpUnit
- Open TestFramework subsection on PhpStorm Preferences
- Add new phpunit Remote
- Set cli interpreter and set path mapping on remote
- Set phpunit executable
- Set configuration file
Codeception
- Open TestFramework subsection on PhpStorm Preferences
- Add new codeception Remote
- Set cli interpreter and set path mapping on remote
- Set codeception executable
- Set configuration file if required
Configure Quality Tools
PHP_CodeSniffer
MessDetector
It requires installation of package "composer require phpmd/phpmd"
PhpCsFixer
PhpStan
- Add PhpStan configuration file
phpstan.neon
at the root directory of the project :
parameters:
level: 8
paths:
- src
- tests/unit
- tests/functional
Psalm
- It requires installation of package
composer require psalm/phar
- Add the following script in composer.json inside the section
scripts
:"psalm": "php ./vendor/bin/psalm.phar"
- Add the following code inside the file
psalm.xml
at the root directory of the project :
<?xml version="1.0"?>
<psalm>
<projectFiles>
<directory name="src" />
</projectFiles>
</psalm>