1

在终端运行命令后,我在 Linux Mint 上安装了 composer 和 phpcs

phpcs --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
4

1 回答 1

2

我发现我使用的代码嗅探器版本太旧 - 2.5,而 Generic.PHP.DisallowAlternativePHPTags 仅在 2.7 中实现。我更新了代码嗅探器,现在一切正常。

于 2017-04-24T03:02:16.377 回答