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 8 Attributes / AttributeDriver #43

Open
barthy-koeln opened this issue Aug 24, 2022 · 0 comments
Open

PHP 8 Attributes / AttributeDriver #43

barthy-koeln opened this issue Aug 24, 2022 · 0 comments

Comments

@barthy-koeln
Copy link
Contributor

Dear Prezent Team,

using this library in a PHP 8.1 and Symfony 5.4 project, I've had to work around this Issue:

In DoctrineAdapter.php line 110:

Cannot adapt Doctrine driver of class Doctrine\ORM\Mapping\Driver\AttributeDriver

The DriverChain in my project contains regular annotation drivers as well, and a hackaround to get rid of the error seems to result in the usual and desired behaviour:

if($omDriver instanceof AttributeDriver){
  $reader = new AnnotationReader();
  return new AnnotationDriver($reader);
}

If I understand correctly, the best way to resolve this would be by actually supporting PHP8 attributes while maintaining support for annotations. Is that correct?

I could try to provide a minimal repoduction repository.

Thanks & Greetings
Barthy

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

1 participant