*UPDATE*
In version 2 of php_cs_fixer
some parameters and rules are renamed. Upgrade guide can be see on their Github page. This how-to is accordingly updated.
Applying PSR-2 coding style manually is really no fun and wasting time. A short visit in Github and there’s a tool which detects and fixes the coding style. The tool is called php-cs-fixer
.
I’ll show you how to get the tool and use it to easily reformat all PHP file in project.