Docker Container with PHPCS setup for Drupal development
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Drupal PHPCS

Drupal PHP Code Sniffer Coding Standards inside a container.

Supported tags and respective Dockerfile links

Docker Pulls MicroBadger Layers Docker Automated build Docker Build Status

This is a Dockerised Solution for running PHPCS with Drupal Standards.

What is PHPCS?

PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second phpcbf script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.

What are Drupal Coding Standards?

The Drupal Coding Standards apply to code within Drupal and its contributed modules. This is maintained by the drupal/coder composer package (

Docker Commands


docker pull willhallonline/drupal-phpcs
docker pull willhallonline/drupal-phpcs:stretch

PHPCS (PHP CodeSniffer)

docker run -it --rm -v $(pwd):/app willhallonline/drupal-phpcs phpcs [YOUR-CODE]
docker run -it --rm -v $(pwd):/app willhallonline/drupal-phpcs:stretch phpcs [YOUR-CODE]

PHPCBF (PHP CodeFixer)

docker run -it --rm -v $(pwd):/app willhallonline/drupal-phpcs phpcbf [YOUR-CODE]
docker run -it --rm -v $(pwd):/app willhallonline/drupal-phpcs:stretch phpcbf [YOUR-CODE]