PHP_CodeSniffer's phpcs
is a script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard.
Basic usage.
docker run --rm \
--volume /local/path:/project \
herloct/phpcs[:tag] [<options>]
For example, to check src
directory against the PSR1 and PSR2 coding standard.
docker run --rm \
--volume /local/path:/project \
herloct/phpcs --standard=PSR1,PSR2 src
/project
: Your PHP project directory.