PHP CS Fixer (PHP Coding Standards Fixer) is, as the name suggests, a tool that modifies PHP code to comply with coding standards. ..
-Build the strongest Laravel development environment using Docker [new edition]
This article is a supplement to the above article.
docker-compose.yml
services:
cs:
image: herloct/php-cs-fixer
volumes:
- ./backend:/project
Add services.cs
.
#Do not automatically shape(Difference display only)
$ docker-compose run cs fix --dry-run -v --diff --diff-format udiff .
#Automatically shape
$ docker-compose run cs fix -v --diff --diff-format udiff .
Makefile
Since the command is long, it is good to prepare a Makefile.
dry-cs:
docker-compose run cs fix --dry-run -v --diff --diff-format udiff .
fix-cs:
docker-compose run cs fix -v --diff --diff-format udiff .
You can execute it with the following command.
$ make dry-cs
$ make fix-cs
-Laravel PHP-CS-Fixer rule settings -Check your PHP file with php-cs-fixer
Recommended Posts