对于php项目,有一段时间我的测试对phpstan和psalm失败,错误消息不明确。
我试图进行调试,重新构建提交,但没有成功。我不明白什么的。
这些是输出量,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但我已经查过密码了,我不知道这一切。
有人能帮我调试吗?
发布于 2022-06-29 14:23:23
这些都是不相关的独立问题。在“诗篇”和“PHPStan GitHub”问题追踪器中,你会有更高的运气询问它们。
https://stackoverflow.com/questions/72802010
复制相似问题