[英]phpstan and psalm ail because of an unidentifiable problem
對於 php 項目,有一段時間我的 phpstan 和 psalm 測試失敗,錯誤消息不清楚。
我試圖調試,重建提交,但沒有成功。 我無法理解。
這些是output 、 composer.json
和ci.yml
。
我可以發現這些線條。 對於psalm
:
Uncaught Error: Call to undefined method ReflectionUnionType::getName() in phar:///home/runner/work/me-tools/me-tools/vendor/psalm/phar/psalm.phar/src/Psalm/Internal/Codebase/Reflection.php:262
對於phpstan
:
PHP Warning: Undefined array key "PHPStan\Rules\Arrays\DuplicateKeysInLiteralArraysRule" in phar:///home/runner/work/me-tools/me-tools/vendor/phpstan/phpstan/phpstan.phar/vendor/nette/utils/src/Utils/Reflection.php on line 180
Warning: Undefined array key "PHPStan\Rules\Arrays\DuplicateKeysInLiteralArraysRule" in phar:///home/runner/work/me-tools/me-tools/vendor/phpstan/phpstan/phpstan.phar/vendor/nette/utils/src/Utils/Reflection.php on line 180
PHP Fatal error: Uncaught TypeError: _HumbugBox5f943a942674\Nette\Utils\Reflection::getUseStatements(): Return value must be of type array, null returned in phar:///home/runner/work/me-tools/me-tools/vendor/phpstan/phpstan/phpstan.phar/vendor/nette/utils/src/Utils/Reflection.php:180
但是我沒有提供幫助,甚至在網上查看我也沒有發現任何有用的東西。
最奇怪的是我無法復制這個問題。 其實在本地,同樣的配置,我是沒有問題的。
關於Call to undefined method ReflectionUnionType::getName ()
的一種可能假設是,某處可能存在如下情況:
public function myMethod(): int | float
但我已經檢查了代碼,但我對此一無所知。
誰能幫我調試?
這些是不相關的單獨問題。 在 Psalm 和 PHPStan GitHub 問題跟蹤器中詢問它們會更幸運。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.