I want to run phpcs tool, but this error is coming,
ERROR: Referenced sniff "PHPCompatibility" does not exist
I ran phpcs -i. That gave me ,
The installed coding standards are PEAR, PSR1, Zend, Squiz, PSR12, PSR2, MySource and PHPCompatibility.
But Always this error is coming, ERROR: Referenced sniff "PHPCompatibility" does not exist. Any reasons ?
According currently PHP Compatibility Coding Standard documentation you need to follow this steps:
composer.json
file and add the following lines to:"require-dev": {
"phpcompatibility/php-compatibility": "*"
},
"prefer-stable" : true,
"scripts": {
"post-install-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility",
"post-update-cmd" : "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility"
}
run composer update
Test with ./vendor/bin/phpcs -p . --standard=PHPCompatibility