This document outlines the tools and procedures for linting and static analysis in this project.
We check against the following standards/rulesets:
The .phpcs.xml.dist file contains a suggested configuration, but you are free to amend this. You can also extend it for more granularity of configuration for theme and custom plugins.
To run PHPCS, navigate to the directory where the relevant .phpcs.xml.dist lives, and type:
vendor/bin/phpcsSee the PHPCS documentation (or run phpcs -h) for the available command line arguments.
We use PHPStan for static analysis to find potential bugs and improve code quality. It's configured in the phpstan.neon file.
To run PHPStan locally, use the following command:
composer analyzeThis will run PHPStan with the configuration defined in phpstan.neon. The command is an alias for vendor/bin/phpstan analyse --memory-limit=1024M.
PHPStan is also part of our CI pipeline and runs automatically on every pull request.