Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Documentation] Deprecate annotations#18590
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Documentation] Deprecate annotations#18590
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| If your PHP version doesn't support attributes yet, use annotations, which is | ||
| similar but requires installing some extra dependencies in your project. |
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.
We can probably remove that paragraph from 6.2 as well. Symfony 6 does not support PHP versions that don't support 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.
Good idea, PR is ready 🙂
configuration/micro_kernel_trait.rst Outdated
| ..deprecated::6.4 | ||
| Annotations are deprecated since Symfony 6.4, use attributes instead. |
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.
Instead of adding this deprecation block, I'd remove thedoctrine/annotations dependency from the command below. We should not recommend to install that package anymore fro new applications.
| ``html+twig`` Twig markup blended with HTML | ||
| ``html+php`` PHP code blended with HTML | ||
| ``ini`` INI | ||
| ``php-annotations`` PHP 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.
I think, we will have to keep this line as long as we still have examples with annotation syntax.
form/unit_testing.rst Outdated
| ..deprecated::6.4 | ||
| Annotations are deprecated since Symfony 6.4, use attributes instead. |
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.
No, just remove theaddDefaultDoctrineAnnotationReader() call from the example above.
routing.rst Outdated
| ..deprecated::6.4 | ||
| Annotations are deprecated since Symfony 6.4, use attributes instead. |
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.
Let's change the code snippets and the paragraph above to use the term "attribute(s)" instead of "annotation(s)" instead.
serializer.rst Outdated
| ------------------------------------- | ||
| You can add:ref:`#[Groups] attributes<component-serializer-attributes-groups-annotations>` | ||
| You can add:ref:`#[Groups] attributes<component-serializer-attributes-groups-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.
The extra whitespaces at the start of the line look like a mistake.
14d8b13 to9918c6fCompare9918c6f to0380429Comparealexandre-daubois commentedJul 21, 2023
Thank you for the review@derrabus, PR updated 🙂 |
javiereguiluz commentedJul 21, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Alex, thanks for another stellar contribution 🙇 Thanks Alexander for your thorough review too! While merging I did a minor change (seedc0ec9f) related to changes like this: -.. _security-securing-controller-annotations:+.. _security-securing-controller-attributes: These internal references are publicly exposed as page anchors. E.g.:https://symfony.com/doc/current/security.html#security-securing-controller-annotations If we remove the old reference, that anchor disappears and the link "breaks" (it doesn't break, but the user is not redirect to a specific section and that can be confusing). For these reasons, we never delete internal references, we just add new ones. Thanks! |
alexandre-daubois commentedJul 21, 2023
Got it, thank you for the explanation about link! 🙏 |
My take on#18589, feedbacks always welcome! 🙂