Hello dear colleagues, just like the last time I would like to share some experience with you regarding tools, that can improve the quality of our code. This time it goes about php-cs-fixer, which, as it's pretty obvious, automatically fixes code style. Yes, PhpStorm does amazing job already, but php-cs-fixer can this and a little more. Installation: composer global require friendsofphp/php-cs-fixer Strating is easy: php-cs-fixer fix /path/to/php/file_or_folder with custom config php-cs-fixer fix --config /path/to/config /path/to/php/file_or_folder The real power lies in the configuration. I have attached an example config, which I am currently using for fixing my code. You can also refer to a configurator, which shows different options and examples: https://mlocati.github.io/php-cs-fixer-configurator/ So what can php-cs-fixer do besides adding/removing unnecessary white spaces and formatting code according to PSR-1/2? 1. We all know there are functions like sizeof, glue, pos. They are nothing but aliases for count, implode and current. php-cs-fixer can replace them automatically. 2. It can automatically replace is_null($var) with $var === null (or null === $var, there is an option for that) 3. ereg extension is deprecated and remove in php 7. php-cs-fixer can automatically replace ereg calls with preg 4. rand functons can be automatically replaced with mt_rand, and later with random_int 5. It can remove unused imports, useless else cases, fixed parameter order within implode 6. Update PhpUnit tests to use PhpUnit with namespaces 7. Align, sort, fix phpdocs and many more. There are presets for working with Symfony, Doctrine, and for PHP migrations from 3.0 to 7.1 Check out the configurator (link above) to see all the possible fixes with examples (click on the fixer name to see documentation and examples). After you committed your code, but before you have pushed, try to run php-cs-fixer and look if it can find anything in your code. Best regards Viktoras -- Best regards Viktoras Bezaras - Integrations Lead - ________________________________________________________ TraSo GmbH Nonnenstraße 42 D-04229 Leipzig Tel.: +49 341 355 740 44 E-Mail: v.bezaras@traso.de Internet: http://www.traso.de ________________________________________________________ Geschäftsführer: Haiko Gerdes Handelsregister: Amtsgericht Leipzig, HRB 21850