在终端
中运行命令后,我在Linux Mint上安装了composer和phpcsphpcs --standard=WordPress-VIP class-wpeka-auto-updater.php
它会引发以下错误
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
答案 0 :(得分:2)
我发现我使用过旧版本的代码嗅探器 - 2.5,并且Generic.PHP.DisallowAlternativePHPTags仅在2.7中实现。我更新了代码嗅探器,现在所有工作都应该正常工作。