Docker image for PHP Code Standard Fixer.
# .gitlab-ci.yml
stages:
- test
job:test:lint:
stage: test
image: ninobysa/php-cs-fixer
script:
- php-cs-fixer fix --dry-run -vvv --diff ./src
docker run --rm -v $(pwd):/app ninobysa/php-cs-fixer fix ./src
In the settings search for "PHP CS Fixer" under "Quality Tools" and add a "configuration" :
- Click "..." then "+" and "..." again.
- Click "+" & select "From Docker".
- Set
ninobysa/php-cs-fixer
as "Image name" (you can use a specific version, for example:ninobysa/php-cs-fixer:v3.3.1-php7.4
) - Click "Ok", wait for the installation check and click "Ok" on the "Cli Interpreters" window.
- Select the newly added interpreter
- Set
php-cs-fixer
as "PHP CS Fixer path". - You're done!
You can find these instructions as a video here.