Sign inSign up

willhallonline/yii-phpcs

By willhallonline

Updated over 7 years ago

Docker Container with PHPCS setup for Yii development

Image
2

3.8K

willhallonline/yii-phpcs repository overview

docker-yii-phpcs

Docker Container with PHPCS setup for Yii development

This Docker Container can be used to setup your environment for Yii development. It combines...

  1. PHP
  2. Composer
  3. PHP CodeSniffer
  4. Yii Coding Standards

... into a simple to use docker container.

So, as an example, here is the whole process of running the custom Yii PHPCS/PHPCBF container:

PHPCS

➜ docker run -it -v $(pwd):/app willhallonline/yii-phpcs phpcs test.php

FILE: /app/test.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one
| | blank line
1 | ERROR | [x] Missing file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 240ms; Memory: 6Mb

PHPCBF

➜ docker run -it -v $(pwd):/app willhallonline/yii-phpcs phpcbf test.php

Changing into directory /app
Processing test.php [PHP => 2 tokens in 1 lines]... DONE in 16ms (2 fixable violations)
=> Fixing file: 0/2 violations remaining [made 4 passes]... DONE in 15ms
Patched 1 file
Time: 225ms; Memory: 6Mb

Tag summary

Content type

Image

Digest

Size

49.3 MB

Last updated

over 7 years ago

docker pull willhallonline/yii-phpcs