PHP Formatter
- Author(s)
- Marc Morera
- Website
- https://github.com/mmoreram/php-formatter
- License
- MIT License
- GitHub
- mmoreram/php-formatter
- Packagist
- mmoreram/php-formatter
- DockerHub
- phpqa/php-formatter
PHP Formatter aims to provide you some bulk actions for your PHP projects to ensure their consistency.
None of them fixes PSR rules.
Installation
- Install from a Composer package as a global CLI utility (with Composer)
- Install from a PHP Archive (with curl or wget)
Install from a Composer package as a global CLI utility (with Composer)
Make sure you have Composer installed.
-
Require it as a global CLI utility:
composer global require mmoreram/php-formatter:dev-master
Run it:
php-formatter
Make sure your global vendor binaries directory is in your $PATH environment variable. Check the Composer documentation for more information.
Install from a PHP Archive (with curl or wget)
The PHPUnit documentation has a clear manual on how to install PHARs on Windows.
If you have the Suhosin extension enabled,
make sure to allow the execution of PHARs in your php.ini
:
suhosin.executor.include.whitelist = phar
- Locally (master)
-
Download it:
wget -O php-formatter.phar https://github.com/mmoreram/php-formatter/blob/master/build/php-formatter.phar?raw=true
orcurl -sSL https://github.com/mmoreram/php-formatter/blob/master/build/php-formatter.phar?raw=true -o php-formatter.phar
Use it:php php-formatter.phar
- Globally (master)
-
Download it:
wget -O php-formatter.phar https://github.com/mmoreram/php-formatter/blob/master/build/php-formatter.phar?raw=true
orcurl -sSL https://github.com/mmoreram/php-formatter/blob/master/build/php-formatter.phar?raw=true -o php-formatter.phar
Install it as an executable:chmod a+x php-formatter.phar
sudo mv php-formatter.phar /usr/local/bin/php-formatter
Use it:php-formatter