Skip to content

herloct/docker-phpcbf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

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.