1

I have installed composer and phpcs on Linux Mint, after running the command in terminal

phpcs --standard=WordPress-VIP class-wpeka-auto-updater.php

it throws the following errors

PHP Fatal error:  Uncaught PHP_CodeSniffer_Exception: Referenced sniff "Generic.PHP.DisallowAlternativePHPTags" does not exist in /home/.config/composer/vendor/squizlabs/php_codesniffer/CodeSniffer.php:1086
Stack trace:
#0 /home/.config/composer/vendor/squizlabs/php_codesniffer/CodeSniffer.php(733): PHP_CodeSniffer->_expandRulesetReference(Object(SimpleXMLElement), '/home/w...', 2)
#1 /home/.config/composer/vendor/squizlabs/php_codesniffer/CodeSniffer.php(1099): PHP_CodeSniffer->processRuleset('/home/w...', 2)
#2 /home/.config/composer/vendor/squizlabs/php_codesniffer/CodeSniffer.php(733): PHP_CodeSniffer->_expandRulesetReference('/home/w...', '/home/w...', 0)
#3 /home/.config/composer/vendor/squizlabs/php_codesniffer/CodeSniffer.php(551): PHP_CodeSniffer->processRuleset('/home/w...')
#4 /home/.config/composer/vendor/squizlabs/php_codesniffer/CodeSniffer/CLI.php(830): PHP_CodeSniffer->initStandard(Array, Array)
#5 /home/.config/comp in /home/.config/composer/vendor/squizlabs/php_codesniffer/CodeSniffer.php on line 1086
2
  • Can you see if one of the included standards works, such as phpcs --standard=PSR2 class-wpeka-auto-updater.php. It also might be helpful to post the top part of the output from phpcs -vv --standard=WordPress-VIP class-wpeka-auto-updater.php where it shows the ruleset processing. This should tell you where PHPCS is looking for the missing sniff. Commented Apr 4, 2017 at 7:11
  • Have same problem. Example of verbose output: pastebin.com/wKpQhc2g Commented Apr 24, 2017 at 1:55

1 Answer 1

2

I found that i use too old version of code sniffer - 2.5, and Generic.PHP.DisallowAlternativePHPTags was implemented only in 2.7. I update code sniffer and now all work as should.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.