Docker hub
links
https://hub.docker.com/r/ysoffner/phpsniffer/
What is PHP_CodeSniffer and phpcs?
PHP_CodeSniffer's phpcs
is a script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard.
PHP Compatibility Coding Standard for PHP CodeSniffer
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.
How to use this image
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
Volumes
/project
: Is your Workdir and PHP project directory.
based from herloct