Skip to content
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

Internal error: Class Doctrine\ORM\EntityRepository does not exist #58

Closed
josefsabl opened this issue Mar 11, 2019 · 7 comments
Closed

Comments

@josefsabl
Copy link

I'd like to open new issue here, but it was discussed after closing this issue: #51

Looks like this plugin depends on the doctrine/orm although it definitely is useful for doctrine/odm as also stated in readme (Also supports Doctrine ODM.).

The fact is that it really works well for ODM project and I could delete a few ignore patterns. But I had to add doctrine/orm to my composer.json to make it work. Which is a shame.

I think it would not harm if this package added doctrine/orm as one of its own dependencies.

@ondrejmirtes
Copy link
Member

I think it would not harm if this package added doctrine/orm as one of its own dependencies.

It should not be solved like this, but instead asking if Doctrine ORM classes exist before using them.

@josefsabl
Copy link
Author

Yeah, of course, that would be ideal :-)

@zacharra
Copy link

zacharra commented Apr 8, 2019

Hello,
is there any progress regarding this issue? In case it isn't obvious already, the issue is this line:

|| $classReflection->isSubclassOf('Doctrine\ORM\EntityRepository')
where isSubclassOf calls \ReflectionClass:isSubclassOf(), which expects the argument class to exist. It could be easily solved with a class_exists check before that, but I don't know if there is a better way, e.g. only conditionally load the extension or something.

@josefsabl
Copy link
Author

In case it isn't obvious already, the issue is this line:

Unfortunatelly changing this line to:

|| (class_exists('Doctrine\ORM\EntityRepository') && $classReflection->isSubclassOf('Doctrine\ORM\EntityRepository'))

Generates tons of other false positive errors.

@ondrejmirtes
Copy link
Member

@josefsabl I don't know what false positives do you mean.

Fixed: 98a7072

@josefsabl
Copy link
Author

I don't know what false positives do you mean.

Please disregard that post of mine. I just wanted to test the proposed solution by @zacharra only to find that it isn't that simple.

@github-actions
Copy link

github-actions bot commented May 2, 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 2, 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

3 participants