Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 1.19 KB

README.md

File metadata and controls

39 lines (26 loc) · 1.19 KB

Supported tags and respective Dockerfile links

What is PHP_CodeSniffer and phpcbf?

PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.

PHP_CodeSniffer's phpcbf is a script to automatically correct coding standard violations.

https://github.com/squizlabs/PHP_CodeSniffer

How to use this image

Basic usage using current user id (uid).

docker run --rm \
    --user $(id -u):$(id -g) \
    --volume $(pwd):/project \
    herloct/phpcbf [<options>]

For example, to fix src directory to follow PSR1 and PSR2 standard.

docker run --rm \
    --user $(id -u):$(id -g) \
    --volume $(pwd):/project \
    herloct/phpcbf --no-patch --standard=PSR1,PSR2 src

Volumes

  • /project: Your PHP project directory.