简体   繁体   中英

phpcs errors on Linux Mint

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM