See CODE_DOCS.md for information on code documentation.
We use PHP-CS-Fixer for PHP
code formatting and include a .php-cs-fixer.dist.php
with some small deviations from
PSR-2.
PHP-CS-Fixer is included as a composer development package and can be installed with:
composer install --dev
To run it across the codebase and fix any formatting issues, run:
./vendor/bin/php-cs-fixer fix
To run it against just a specific set of files:
./vendor/bin/php-cs-fixer fix file1 file2 ...
See also our Best Practices guide in the wiki.
We use prettier for JS code formatting.
prettier is included as an npm development dependency and can be installed with:
npm install
Npm can be installed with node as documented in DEVELOPMENT.
To run the linter:
npm run format-check
To have prettier auto-fix formatting issues where it can run:
npm run format