Sign inSign up

gruen/phpcs

By gruen

•Updated over 9 years ago

Run PHPCS in a docker container

Image
0

2.5K

gruen/phpcs repository overview

⁠gruen/phpcs

PHP Code Sniffer container

Take a look at the phpcs homepage⁠

⁠Usage

The default ENTRYPOINT is phpcs

The default CMD parameters are --standard=PSR2 and /app

without adding anything it will run against the current directory (recursively) against the PSR2 standard

docker run -i \
    --rm \
    -v "$(pwd)":/app \
    --name phpcs_"$(date +%s)" \
    gruen/phpcs

you can override the defaults by passing any of the phpcs options

docker run -i \
    --rm \
    -v "$(pwd)":/app \
    --name phpcs_"$(date +%s)" \
    gruen/phpcs --standard=pear /app/src

You can create an alias with the following

docker run -i --rm \
    -v "$(pwd)":/app \
    --name phpcs_"$(date +%s%N)" \
    gruen/phpcs "$@"

I use the "$(date +%s%N)" to prevent naming conflicts when running multiple containers simultaneously

Tag summary

Content type

Image

Digest

Size

26.3 MB

Last updated

over 9 years ago

docker pull gruen/phpcs