Sign inSign up

shouldbee/php-cs-fixer

By shouldbee

Updated almost 11 years ago

Image
1

651

shouldbee/php-cs-fixer repository overview

docker-php-code-fixer

PHP Coding Standards Fixer analyzes some PHP source code and tries to fix coding standards issues (PSR-1 and PSR-2 compatible). This is a docker image that eases setup.

About PHP Coding Standars Fixer

The PHP Coding Standards Fixer tool fixes most issues in your code when you want to follow the PHP coding standards as defined in the PSR-1 and PSR-2 documents.

If you are already using PHP_CodeSniffer to identify coding standards problems in your code, you know that fixing them by hand is tedious, especially on large projects. This tool does the job for you.

From: fabpot/PHP-CS-Fixer

Install

This docker image is available as an automated build on the docker registry hub, so using it is as simple as running:

$ docker run shouldbee/php-cs-fixer

To further ease running, it's recommended to set up a much shorter function so that you can easily execute it as just php-cs-fixer:

$ php-cs-fixer () {
  docker run -it --rm --net host -v `pwd`:/wd -w /wd shouldbee/php-cs-fixer $@
}

This will create a temporary function. In order to make it persist reboots, you can append this exact line to your ~/.bashrc (or similar) like this:

$ declare -f php-cs-fixer >> ~/.bashrc

Usage

Usage from fabpot/PHP-CS-Fixer

The fix command tries to fix as much coding standards problems as possible on a given file or directory:

php php-cs-fixer.phar fix /path/to/dir
php php-cs-fixer.phar fix /path/to/file

See official site for more information.

Tag summary

Content type

Image

Digest

sha256:4f114f1fc

Size

104.9 MB

Last updated

almost 11 years ago

docker pull shouldbee/php-cs-fixer