Fork me on GitHub
a Sensio Labs Product

I ate three cookies πŸͺ (v3.40.2) edition

InstallationΒΆ

RequirementsΒΆ

PHP needs to be a minimum version of PHP 7.4.

InstallationΒΆ

LocallyΒΆ

Download the php-cs-fixer.phar file and store it somewhere on your computer.

Globally (manual)ΒΆ

You can run these commands to easily access latest php-cs-fixer from anywhere on your system:

wget https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer

or with specified version:

wget https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/v3.13.0/php-cs-fixer.phar -O php-cs-fixer

or with curl:

curl -L https://cs.symfony.com/download/php-cs-fixer-v3.phar -o php-cs-fixer

then:

sudo chmod a+x php-cs-fixer
sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer

Then, just run php-cs-fixer.

Globally (Composer)ΒΆ

To install PHP CS Fixer, install Composer and issue the following command:

composer global require friendsofphp/php-cs-fixer

Then make sure you have the global Composer binaries directory in your PATH. This directory is platform-dependent, see Composer documentation for details. Example for some Unix systems:

export PATH="$PATH:$HOME/.composer/vendor/bin"

Globally (homebrew)ΒΆ

brew install php-cs-fixer

Locally (PHIVE)ΒΆ

Install PHIVE and issue the following command:

phive install php-cs-fixer # use `--global` for global install

UpdateΒΆ

LocallyΒΆ

The self-update command tries to update php-cs-fixer itself:

php php-cs-fixer.phar self-update

Globally (manual)ΒΆ

You can update php-cs-fixer through this command:

sudo php-cs-fixer self-update

Globally (Composer)ΒΆ

You can update php-cs-fixer through this command:

./composer.phar global update friendsofphp/php-cs-fixer

Globally (homebrew)ΒΆ

You can update php-cs-fixer through this command:

brew upgrade php-cs-fixer

Locally (PHIVE)ΒΆ

phive update php-cs-fixer