You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We appear to have found an issues that was introduced via phpstan/phpstan-doctrine 1.2.1. Downgrading phpstan/phpstan-doctrine 1.2.0, the error is not presented and PHPStan completes successfully.
PHPStan Version 1.4.2
We appear to have found an issues that was introduced via phpstan/phpstan-doctrine 1.2.1. Downgrading phpstan/phpstan-doctrine 1.2.0, the error is not presented and PHPStan completes successfully.
When attempting to run PHPStan we are presented with the the following:
Internal error: Class 'Doctrine\ORM\Mapping\ClassMetadataFactory' not found
Run PHPStan with --debug option and post the stack trace to:
https://github.com/phpstan/phpstan/issues/new?template=Bug_report.md
When doing as suggested, the following stack trace is provided:
/var/source/Module.php
Uncaught Error: Class 'Doctrine\ORM\Mapping\ClassMetadataFactory' not found in /root/.composer/vendor/phpstan/phpstan-doctrine/src/Doctrine/Mapping/ClassMetadataFactory.php:16
#0 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/vendor/composer/ClassLoader.php(571): include()
#1 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/root/.composer...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('PHPStan\Doctrin...')
#3 /root/.composer/vendor/phpstan/phpstan-doctrine/src/Type/Doctrine/ObjectMetadataResolver.php(89): spl_autoload_call('PHPStan\Doctrin...')
#4 /root/.composer/vendor/phpstan/phpstan-doctrine/src/Type/Doctrine/ObjectMetadataResolver.php(71): PHPStan\Type\Doctrine\ObjectMetadataResolver->getMetadataFactory()
#5 /root/.composer/vendor/phpstan/phpstan-doctrine/src/Type/Doctrine/ObjectMetadataResolver.php(101): PHPStan\Type\Doctrine\ObjectMetadataResolver->isTransient('Cap\Logging\Mod...')
#6 /root/.composer/vendor/phpstan/phpstan-doctrine/src/Rules/Doctrine/ORM/PropertiesExtension.php(25): PHPStan\Type\Doctrine\ObjectMetadataResolver->getClassMetadata('Cap\Logging\Mod...')
#7 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/src/Rules/DeadCode/UnusedPrivatePropertyRule.php(103): PHPStan\Rules\Doctrine\ORM\PropertiesExtension->isAlwaysRead(Object(PHPStan\Reflection\Php\PhpPropertyReflection), 'config')
#8 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/FileAnalyser.php(94): PHPStan\Rules\DeadCode\UnusedPrivatePropertyRule->processNode(Object(PHPStan\Node\ClassPropertiesNode), Object(PHPStan\Analyser\MutatingScope))
#9 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(545): PHPStan\Analyser\FileAnalyser->PHPStan\Analyser{closure}(Object(PHPStan\Node\ClassPropertiesNode), Object(PHPStan\Analyser\MutatingScope))
#10 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(298): PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Class_), Object(PHPStan\Analyser\MutatingScope), Object(Closure))
#11 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(510): PHPStan\Analyser\NodeScopeResolver->processStmtNodes(Object(PhpParser\Node\Stmt\Namespace_), Array, Object(PHPStan\Analyser\MutatingScope), Object(Closure))
#12 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(269): PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Namespace_), Object(PHPStan\Analyser\MutatingScope), Object(Closure))
#13 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/FileAnalyser.php(181): PHPStan\Analyser\NodeScopeResolver->processNodes(Array, Object(PHPStan\Analyser\MutatingScope), Object(Closure))
#14 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/Analyser.php(69): PHPStan\Analyser\FileAnalyser->analyseFile('/var/source/Mod...', Array, Object(PHPStan\Rules\Registry), NULL)
#15 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/src/Command/AnalyserRunner.php(62): PHPStan\Analyser\Analyser->analyse(Array, Object(Closure), NULL, true, Array)
#16 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/src/Command/AnalyseApplication.php(163): PHPStan\Command\AnalyserRunner->runAnalyser(Array, Array, Object(Closure), NULL, true, true, '/var/source/php...', NULL, NULL, Object(_PHPStan_70b6e53dc\Symfony\Component\Console\Input\ArgvInput))
#17 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/src/Command/AnalyseApplication.php(95): PHPStan\Command\AnalyseApplication->runAnalyser(Array, Array, true, '/var/source/php...', Object(PHPStan\Command\Symfony\SymfonyOutput), Object(PHPStan\Command\Symfony\SymfonyOutput), Object(_PHPStan_70b6e53dc\Symfony\Component\Console\Input\ArgvInput))
#18 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/src/Command/AnalyseCommand.php(175): PHPStan\Command\AnalyseApplication->analyse(Array, false, Object(PHPStan\Command\Symfony\SymfonyOutput), Object(PHPStan\Command\Symfony\SymfonyOutput), false, true, '/var/source/php...', Array, Object(_PHPStan_70b6e53dc\Symfony\Component\Console\Input\ArgvInput))
#19 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Command/Command.php(259): PHPStan\Command\AnalyseCommand->execute(Object(_PHPStan_70b6e53dc\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_70b6e53dc\Symfony\Component\Console\Output\ConsoleOutput))
#20 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(848): _PHPStan_70b6e53dc\Symfony\Component\Console\Command\Command->run(Object(_PHPStan_70b6e53dc\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_70b6e53dc\Symfony\Component\Console\Output\ConsoleOutput))
#21 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(259): _PHPStan_70b6e53dc\Symfony\Component\Console\Application->doRunCommand(Object(PHPStan\Command\AnalyseCommand), Object(_PHPStan_70b6e53dc\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_70b6e53dc\Symfony\Component\Console\Output\ConsoleOutput))
#22 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(157): _PHPStan_70b6e53dc\Symfony\Component\Console\Application->doRun(Object(_PHPStan_70b6e53dc\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_70b6e53dc\Symfony\Component\Console\Output\ConsoleOutput))
#23 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan(94): _PHPStan_70b6e53dc\Symfony\Component\Console\Application->run()
#24 phar:///root/.composer/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan(95): _PHPStan_70b6e53dc{closure}()
#25 /root/.composer/vendor/phpstan/phpstan/phpstan(7): require('phar:///root/.c...')
#26 /root/.composer/vendor/bin/phpstan(102): include('/root/.composer...')
#27 {main}
ERROR: 1
Expected output
We would expect PHPStan to complete successfully but it does not, and produces the internal error documented above.
The text was updated successfully, but these errors were encountered: