Empty cover breaks phpstan
shyim opened this issue · 5 comments
shyim commented
/**
* @covers
*/
class SyncComposerVersionCommandTest extends TestCase
breaks complete phpstan
Internal error: Internal error: Name cannot be empty in file /Users/shyim/Code/platform/tests/unit/php/Core/DevOps/System/Command/SyncComposerVersionCommandTest.php
Post the following stack trace to https://github.com/phpstan/phpstan/issues/new?template=Bug_report.md:
#0 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php(21): PhpParser\Node\Name::prepareName('')
#1 /Users/shyim/Code/platform/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/CoversHelper.php(98): PhpParser\Node\Name->__construct('', Array)
#2 /Users/shyim/Code/platform/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/ClassCoversExistsRule.php(86): PHPStan\Rules\PHPUnit\CoversHelper->processCovers(Object(PHPStan\Node\InClassNode),
Object(PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode), NULL)
#3 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/FileAnalyser.php(106): PHPStan\Rules\PHPUnit\ClassCoversExistsRule->processNode(Object(PHPStan\Node\InClassNode),
Object(PHPStan\Analyser\MutatingScope))
#4 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(582): PHPStan\Analyser\FileAnalyser->PHPStan\Analyser\{closure}(Object(PHPStan\Node\InClassNode),
Object(PHPStan\Analyser\MutatingScope))
#5 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(360): PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Class_),
Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#6 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(571): PHPStan\Analyser\NodeScopeResolver->processStmtNodes(Object(PhpParser\Node\Stmt\Namespace_), Array,
Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#7 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(327): PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Namespace_),
Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#8 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/FileAnalyser.php(175): PHPStan\Analyser\NodeScopeResolver->processNodes(Array, Object(PHPStan\Analyser\MutatingScope),
Object(Closure))
#9 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/src/Command/WorkerCommand.php(148): PHPStan\Analyser\FileAnalyser->analyseFile('/Users/shyim/Co...', Array, Object(PHPStan\Rules\LazyRegistry),
Object(PHPStan\Collectors\Registry), NULL)
#10 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(97): PHPStan\Command\WorkerCommand->PHPStan\Command\{closure}(Array)
#11 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/vendor/clue/ndjson-react/src/Decoder.php(110): _PHPStan_4dd92cd93\Evenement\EventEmitter->emit('data', Array)
#12 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(97): _PHPStan_4dd92cd93\Clue\React\NDJson\Decoder->handleData(Array)
#13 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/vendor/react/stream/src/Util.php(62): _PHPStan_4dd92cd93\Evenement\EventEmitter->emit('data', Array)
#14 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(97):
_PHPStan_4dd92cd93\React\Stream\Util::_PHPStan_4dd92cd93\React\Stream\{closure}('{"action":"anal...')
#15 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/vendor/react/stream/src/DuplexResourceStream.php(154): _PHPStan_4dd92cd93\Evenement\EventEmitter->emit('data', Array)
#16 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/vendor/react/event-loop/src/StreamSelectLoop.php(201): _PHPStan_4dd92cd93\React\Stream\DuplexResourceStream->handleData(Resource id #39633)
#17 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/vendor/react/event-loop/src/StreamSelectLoop.php(173): _PHPStan_4dd92cd93\React\EventLoop\StreamSelectLoop->waitForStreamActivity(NULL)
#18 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/src/Command/WorkerCommand.php(108): _PHPStan_4dd92cd93\React\EventLoop\StreamSelectLoop->run()
#19 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Command/Command.php(259):
PHPStan\Command\WorkerCommand->execute(Object(_PHPStan_4dd92cd93\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_4dd92cd93\Symfony\Component\Console\Output\ConsoleOutput))
#20 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(870):
_PHPStan_4dd92cd93\Symfony\Component\Console\Command\Command->run(Object(_PHPStan_4dd92cd93\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_4dd92cd93\Symfony\Component\Console\Output\ConsoleOutput))
#21 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(261):
_PHPStan_4dd92cd93\Symfony\Component\Console\Application->doRunCommand(Object(PHPStan\Command\WorkerCommand), Object(_PHPStan_4dd92cd93\Symfony\Component\Console\Input\ArgvInput),
Object(_PHPStan_4dd92cd93\Symfony\Component\Console\Output\ConsoleOutput))
#22 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(157):
_PHPStan_4dd92cd93\Symfony\Component\Console\Application->doRun(Object(_PHPStan_4dd92cd93\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_4dd92cd93\Symfony\Component\Console\Output\ConsoleOutput))
#23 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan(124): _PHPStan_4dd92cd93\Symfony\Component\Console\Application->run()
#24 phar:///Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan(125): _PHPStan_4dd92cd93\{closure}()
#25 /Users/shyim/Code/platform/vendor/phpstan/phpstan/phpstan(8): require('phar:///Users/s...')
#26 /Users/shyim/Code/platform/vendor/bin/phpstan(120): include('/Users/shyim/Co...')
#27 {main}
Child process error (exit code 1):
ondrejmirtes commented
Please post the stack trace.
ondrejmirtes commented
/cc @mad-briller
shyim commented
updated it
mad-briller commented
should be fixed in 1.3.4:
https://github.com/phpstan/phpstan-phpunit/releases/tag/1.3.4
github-actions commented
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.