A really useful tool to keep your code clean is PHP Coding Standards Fixer.
It allows us to follow the PHP standards defined in PSR-1, PSR-2, etc. It is also possible to configure it to follow the style of your team with a documentation.
The recommended way to install it is outside your code, but if you use Symfony, you can install it directly as a dependency of your project.
compose requires --dev friendsofphp/php-cs-fixer
Once this is done, it can be launched in the following way
php vendor/friendsofphp/php-cs-fixer/php-cs-fixer fix src
During the first execution, the configuration is created

And the first corrections take place. So your code will follow the rules of PHP, PSR without you needing to be too careful during PRs.
Don’t forget to commit the .php_cs.dist file!
