Closed
Description
Description
Doctrine Annotations have served us well, but PHP attributes are the future.
Our strategy for Symfony 6 was to support Doctrine Annotations and PHP attributes as two ways of annotating pieces of configuration to code. In Symfony 7, attributes will be the only supported way. However, we still use the word "annotation" in the codebase in an abstract sense (PHP attributes are a form of annotation). This might be confusing, so we might consider using the work "attribute" everywhere consistently.
I've opened this issue to collect all occurrences of the term and to discuss the possible impact on downstream projects.
- The
serializer
integration of FrameworkBundle exposes a configuration optionenable_annotations
. Rename toenable_attributes
. - The
validation
integration of FrameworkBundle exposes a configuration optionenable_annotations
. Rename toenable_attributes
. - The Routing and Serializer components organize their attribute classes in a namespace called
Annotation
. Rename that namespace toAttribute
. - When loading routes from attributes, the loader type is
annotation
althoughattribute
is already an alias for that. Makeattribute
the only possible type. - Serializer uses a class named
AnnotationLoader
to load metadata from attributes. Rename toAttributeLoader
. - Validation uses a class named
AnnotationLoader
to load metadata from attributes. Rename toAttributeLoader
. - Routing contains classes
AnnotationClassLoader
andAnnotationDirectoryLoader
for loading routes from attributes. Rename toAttributeClassLoader
andAttributeDirectoryLoader
.
If you find more TODOs, please drop a comment.