Skip to content

Uncaught TypeError: PHPStan\Type\Doctrine\ObjectMetadataResolver::loadObjectManager() #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MP-okui opened this issue Jun 2, 2020 · 4 comments

Comments

@MP-okui
Copy link

MP-okui commented Jun 2, 2020

Fatal error: Uncaught TypeError: Return value of PHPStan\Type\Doctrine\ObjectMetadataResolver::loadObjectManager() must be an instance of Doctrine\Common\Persistence\ObjectManager or null, instance of Doctrine\ORM\EntityManager returned in /var/www/html/vendor/phpstan/phpstan-doctrine/src/Type/Doctrine/ObjectMetadataResolver.php:69
Stack trace:
#0 /var/www/html/vendor/phpstan/phpstan-doctrine/src/Type/Doctrine/ObjectMetadataResolver.php(55): PHPStan\Type\Doctrine\ObjectMetadataResolver->loadObjectManager('/var/www/html/t...')
#1 /var/www/html/vendor/phpstan/phpstan-doctrine/src/Rules/Doctrine/ORM/EntityColumnRule.php(61): PHPStan\Type\Doctrine\ObjectMetadataResolver->getObjectManager()
#2 phar:///var/www/html/vendor/phpstan/phpstan/phpstan/src/Analyser/FileAnalyser.php(69): PHPStan\Rules\Doctrine\ORM\EntityColumnRule->processNode(Object(PhpParser\Node\Stmt\PropertyProperty), Object(PHPStan\Analyser\MutatingScope))
#3 phar:///var/www/html/vendor/phpstan/phpstan/phpstan/src/Analyser/NodeScopeResolver.php(243): PHPStan\Analy in /var/www/html/vendor/phpstan/phpstan-doctrine/src/Type/Doctrine/ObjectMetadataResolver.php on line 69

  • phpstan/phpstan v0.12.25
  • phpstan/phpstan-doctrine ^0.12.13
  • doctrine/orm v2.7.3
@ondrejmirtes
Copy link
Member

Duplicate of #130

@ondrejmirtes ondrejmirtes marked this as a duplicate of #130 Jun 2, 2020
@ondrejmirtes
Copy link
Member

You can test it with phpstan-doctrine dev-master but it also needs phpstan/phpstan dev-master.

@MP-okui
Copy link
Author

MP-okui commented Jun 2, 2020

@ondrejmirtes

The error has been resolved. Thank you.

  • phpstan/phpstan dev-master
  • phpstan/phpstan-doctrine dev-master
  • doctrine/orm v2.7.3
  • doctrine/persistence v2.0.0

@github-actions
Copy link

github-actions bot commented May 1, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants