https://hub.docker.com/r/ysoffner/phpsniffer/
PHP_CodeSniffer's phpcs
is a script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard.
This is a set of sniffs for PHP CodeSniffer that checks for PHP version compatibility. It will allow you to analyse your code for compatibility with higher and lower versions of PHP.
Basic usage.
docker run --rm \
--volume /local/path:/project \
ysoffner/phpsniffer[:tag] [<options>]
For example, to check src
directory against the PSR1 and PSR2 coding standard.
docker run --rm \
--volume /local/path:/project \
ysoffner/phpsniffer \
--standard=PSR1,PSR2 \
file/path
Example, to use phpCompatibility
.
docker run --rm \
--volume /local/path:/project \
ysoffner/phpsniffer \
--standard=PHPCompatibility --extensions=php --runtime-set testVersion 7.1 \
file/path
/project
: Is your Workdir and PHP project directory.
based from herloct