-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Documentation] Deprecate annotations #18590
Conversation
10000
best_practices.rst
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 the doctrine/annotations
dependency from the command below. We should not recommend to install that package anymore fro new applications.
@@ -118,7 +118,6 @@ Markup Format Use It to Display | |||
``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 the addDefaultDoctrineAnnotationReader()
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
.. _serializer-using-serialization-groups-attributes: | ||
|
||
Using Serialization Groups Attributes | ||
------------------------------------- | ||
|
||
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
to
9918c6f
Compare
9918c6f
to
0380429
Compare
Thank you for the review @derrabus, PR updated 🙂 |
Alex, thanks for another stellar contribution 🙇 Thanks Alexander for your thorough review too! While merging I did a minor change (see dc0ec9f) 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! |
Got it, thank you for the explanation about link! 🙏 |
My take on #18589, feedbacks always welcome! 🙂