PHP_CodeSniffer rules (sniffs) to enforce Noomaa's Coding Standards.
The Noomaa Coding Standards require PHP 7.0.0 or higher and PHP_CodeSniffer version 3.5.0 or higher.
-
Install PHP_CodeSniffer by following its installation instructions (via Composer, Phar file, PEAR, or Git checkout).
Do ensure that PHP_CodeSniffer's version matches our requirements.
-
Install Noomaa standards globally:
composer global require noomaa/codingstandards
OR DEV version
composer global require noomaa/codingstandards:dev-main
-
Setting the default standard to be the Noomaa coding standard
phpcs --config-set default_standard Noomaa
Run the phpcs
command line tool on a given file or directory, for example:
phpcs --standard=Noomaa test-file.php
- Visual Studio: Please see "Setting up PHP CodeSniffer in Visual Studio Code", a tutorial by Tom McFarlin.
- Dealerdirect: PHP_CodeSniffer Standards Composer Installer Plugin