提问人:footy 提问时间:2/11/2023 更新时间:2/11/2023 访问量:68
Magento phpcodeniffer 异常
magento phpcodeniffer exception
问:
当我按照文档运行 magento2 扩展的 codesniffer 时 - https://developer.adobe.com/commerce/php/coding-standards/
从magento根目录我运行
vendor/bin/phpcbf --standard=Magento2 ./app/code/Test/Module
我收到以下错误
PHP Fatal error: Uncaught PHP_CodeSniffer\Exceptions\RuntimeException: The $start position for getTokensAsString() must exist in the token stack in /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Files/File.php:2112
Stack trace:
#0 /home/cloudpanel/htdocs/magento2.mgt/vendor/magento/magento-coding-standard/Magento2/Sniffs/Functions/FunctionsDeprecatedWithoutArgumentSniff.php(66): PHP_CodeSniffer\Files\File->getTokensAsString()
#1 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Files/File.php(498): Magento2\Sniffs\Functions\FunctionsDeprecatedWithoutArgumentSniff->process()
#2 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php(92): PHP_CodeSniffer\Files\File->process()
#3 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Fixer.php(174): PHP_CodeSniffer\Files\LocalFile->process()
#4 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php(52): PHP_CodeSniffer\Fixer->fixFile()
#5 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Reporter.php(285): PHP_CodeSniffer\Reports\Cbf->generateFileReport()
#6 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Runner.php(657): PHP_CodeSniffer\Reporter->cacheFileReport()
#7 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Runner.php(434): PHP_CodeSniffer\Runner->processFile()
#8 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Runner.php(200): PHP_CodeSniffer\Runner->run()
#9 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/bin/phpcbf(18): PHP_CodeSniffer\Runner->runPHPCBF()
#10 /home/cloudpanel/htdocs/magento2.mgt/vendor/bin/phpcbf(120): include('...')
#11 {main}
thrown in /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Files/File.php on line 2112
我的PHP版本是
PHP 8.1.8 (cli) (built: Jul 8 2022 07:08:08) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.8, Copyright (c) Zend Technologies
with Zend OPcache v8.1.8, Copyright (c), by Zend Technologies
我正在使用Magento 2.4.4
这里有什么问题?
答: 暂无答案
评论