-
Notifications
You must be signed in to change notification settings - Fork 517
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
do not rely on annotations to use attributes #1357
Conversation
474ac31
to
6a92547
Compare
@@ -58,7 +59,7 @@ | |||
"symfony/yaml": "^5.4 || ^6.0" | |||
}, | |||
"suggest": { | |||
"doctrine/annotations": "If your project use doctrine-bundle:>=2.8, this package is required to use annotations or attributes", | |||
"doctrine/annotations": "If you use doctrine/doctrine-bundle >2.7, this package is required to use annotations", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect wording here - the package is required to use annotations and attributes - not just annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the purpose of this PR is indeed allowing the use of attributes without relying on doctrine annotations
@@ -138,16 +140,22 @@ protected function registerAnnotationStrategy(ContainerBuilder $container, array | |||
} | |||
|
|||
switch ($config['metadata']['type']) { | |||
case 'attribute': | |||
case 'annotation': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not resolve the issue because this bundle's attribute reader requires Doctrine\Common\Annotations\Reader
which is part of doctrine/annotations
.
With this PR, when using attributes the following error is now thrown in src/Metadata/Driver/AttributeReader.php (line 15):
Attempted to load interface "Reader" from namespace "Doctrine\Common\Annotations".
Did you forget a "use" statement for "Symfony\Component\CssSelector\Parser\Reader"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be working now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be working for attributes 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be working for attributes +1
thank you for checking. Do you have the possibility to check it for annotations too? It would be awesome
0e504a7
to
a179ffe
Compare
Fix #1344