A theme for therapists.
composer install
npm install
This project uses PHP_CodeSniffer (installed via Composer) to lint PHP. It also uses wpcs (WordPress coding standards) 'sniffs' to validate code in adherence with WP coding standards.
Install PHP_CodeSniffer globally
composer global require "squizlabs/php_codesniffer=*"
Make sure you have the composer bin dir in your PATH. The default value is ~/.composer/vendor/bin, but you can check the value that you need to use by running composer global config bin-dir --absolute
Open ~/.bashrc and add a line to update the PATH variable with this location.
sudo nano ~/.bashrc
Add/update the following line:
export PATH="~/.composer/vendor/bin:$PATH"`
Save and close, then reload your bash config:
source ~/.bashrc
Confirm the variable now contains the location:
echo $PATH
"phpcs.executablePath": "./vendor/squizlabs/php_codesniffer/bin/phpcs",
"phpcs.standard": "WordPress",
"phpcs.composerJsonPath": ".composer.json",
"phpcbf.executablePath": "./vendor/squizlabs/php_codesniffer/bin/phpcbf",
"phpcbf.standard": "WordPress",
"phpsab.executablePathCS": "./vendor/squizlabs/php_codesniffer/bin/phpcs",
"phpsab.executablePathCBF": "./vendor/squizlabs/php_codesniffer/bin/phpcbf",
"phpsab.composerJsonPath": ".composer.json",
./vendor/squizlabs/php_codesniffer/bin/phpcs --config-set installed_paths ../../wp-coding-standards/wpcs
Check the installed standards:
'./vendor/squizlabs/php_codesniffer/bin/phpcs -i'
'./vendor/bin/phpcs --standard=WordPress /path/to/code/myfile.inc'
Check code
'./vendor/bin/phpcs **/*.php'
Fix Code
'./vendor/bin/phpcbf **/*.php'
Summarise large outputs:
'./vendor/bin/phpcs --report=summary **/*.php'
PHP_CodeSniffer Github WordPress Coding Standards for PHP_CodeSniffer Github