Skip to content
On this page

Code Style

PHP CS Fixer

For all PHP code (except for views), we follow Symfony-ish, that is minus a couple of things we don't like, e.g. Yoda conditions.

Yes we know WordPress does its own thing code style wise, but honestly? It's terrible! PHP has widely recognised modern standards via PHP-fig, which are used almost everywhere apart from ancient codebases like WordPress and Moodle.

We use PHP CS Fixer as part of our usual workflow and set up for this is included in the Forme theme and plugin boilerplates.

You can change the rules as you see fit by editing the php-cs-fixer.dist configuration file in the plugin or theme repo.

You can also run it on the command line within plugin and theme projects via the following composer commands:

bash
composer cs:check # run without changing anything
composer cs:fix # run all the changes

Made by Moussa Clarke @ Sanders Web Works with ❤️