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

PHP Warning: class_implements() in ReadOnlySubscriber #15

Open
thedustin opened this issue Jul 24, 2020 · 4 comments
Open

PHP Warning: class_implements() in ReadOnlySubscriber #15

thedustin opened this issue Jul 24, 2020 · 4 comments

Comments

@thedustin
Copy link

Hey, I found this messages in my error logs:

[20-Jul-2020 13:41:20 Europe/Berlin] PHP Warning:  class_implements(): Class  does not exist and could not be loaded in %kernel.project_dir%/vendor/steevanb/doctrine-read-only-hydrator/EventSubscriber/ReadOnlySubscriber.php on line 64

Installed version: 2.2.3
PHP version: 7.2.26
Symfony version: 4.4.4

I only had a quick look at it, but found no reason for this warning. I saw in the git history that there is already a commit that is trying to fix this problem by catching the thrown exception. The problem with this fix is that it catches the wrong exceptions. A PHP Warning ist not an \Exception, it‘s an \Error (see Errors in PHP 7).

It also seems that the whole method is not working correctly at the moment. The second parameter of class_implements is a boolean which allows to autoload the given class - it does not check whether or not \steevanb\DoctrineReadOnlyHydrator\Entity\ReadOnlyEntityInterface is implemented.

@steevanb
Copy link
Owner

steevanb commented Jul 24, 2020

Hi,

I'm on holidays, i will check tout code in 2 weeks.

Thanks!

@thedustin
Copy link
Author

Hello,

as we are currently updating our system to some new major versions, this topic pops up again. Is this repository still maintained? And would you have time to take a look into this issue again, please? 😅

@steevanb
Copy link
Owner

steevanb commented Jun 20, 2022

Hi :)

I've made a little fix here: #24, could you please try it?
Depending of your composer.json, you should only need to execute composer require steevanb/doctrine-read-only-hydrator:dev-issue-15

@steevanb
Copy link
Owner

I'm sorry to ask you do try, i don't have any unit test in this repository...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants