Attributes are the successor of annotations since PHP 8. Attributes are native to the language and Symfony takes full advantage of them across the framework and its different components.
- :doc:`UniqueEntity </reference/constraints/UniqueEntity>`
- :ref:`MapEntity <doctrine-entity-value-resolver>`
- :ref:`Required <autowiring-calls>`
- :ref:`SubscribedService <service-subscribers-service-subscriber-trait>`
- :ref:`AsAlias <services-alias>`
- :doc:`AsDecorator </service_container/service_decoration>`
- :ref:`AsTaggedItem <tags_as-tagged-item>`
- :ref:`Autoconfigure <lazy-services_configuration>`
- :ref:`AutoconfigureTag <di-instanceof>`
- :ref:`Autowire <autowire-attribute>`
- :ref:`AutowireCallable <autowiring_closures>`
- :doc:`AutowireDecorated </service_container/service_decoration>`
- :ref:`AutowireIterator <service-locator_autowire-iterator>`
- :ref:`AutowireLocator <service-locator_autowire-locator>`
- :ref:`AutowireMethodOf <autowiring_closures>`
- :ref:`AutowireServiceClosure <autowiring_closures>`
- :ref:`Exclude <service-psr4-loader>`
- :ref:`Lazy <lazy-services_configuration>`
- :ref:`TaggedIterator <tags_reference-tagged-services>`
- :ref:`TaggedLocator <service-subscribers-locators_defining-service-locator>`
- :ref:`Target <autowiring-multiple-implementations-same-type>`
- :ref:`When <service-container_limiting-to-env>`
- :ref:`WhenNot <service-container_limiting-to-env>`
.. deprecated:: 7.1 The :class:`Symfony\\Component\\DependencyInjection\\Attribute\\TaggedIterator` and :class:`Symfony\\Component\\DependencyInjection\\Attribute\\TaggedLocator` attributes were deprecated in Symfony 7.1.
- :doc:`AsController </controller/service>`
- :ref:`AsTargetedValueResolver <controller-targeted-value-resolver>`
- :ref:`Cache <http-cache-expiration-intro>`
- :ref:`MapDateTime <functionality-shipped-with-the-httpkernel>`
- :ref:`MapQueryParameter <controller_map-request>`
- :ref:`MapQueryString <controller_map-request>`
- :ref:`MapRequestPayload <controller_map-request>`
- :ref:`MapUploadedFile <controller_map-uploaded-file>`
- :ref:`ValueResolver <managing-value-resolvers>`
- :ref:`WithHttpStatus <framework_exceptions>`
- :ref:`WithLogLevel <framework_exceptions>`
- :ref:`AsCronTask <scheduler-attributes-cron-task>`
- :ref:`AsPeriodicTask <scheduler-attributes-periodic-task>`
- :ref:`AsSchedule <scheduler_attaching-recurring-messages>`
- :ref:`CurrentUser <security-json-login>`
- :ref:`IsCsrfTokenValid <csrf-controller-attributes>`
- :ref:`IsGranted <security-securing-controller-attributes>`
- :ref:`Context <serializer-context>`
- :ref:`DiscriminatorMap <serializer_interfaces-and-abstract-classes>`
- :ref:`Groups <serializer-groups-attribute>`
- :ref:`Ignore <serializer_ignoring-attributes>`
- :ref:`MaxDepth <serializer_handling-serialization-depth>`
- :ref:`SerializedName <serializer-name-conversion>`
- :ref:`SerializedPath <serializer-nested-structures>`
Each validation constraint comes with a PHP attribute. See :doc:`/reference/constraints` for a full list of validation constraints.
- :ref:`AsAnnounceListener <workflow_using-events>`
- :ref:`AsCompletedListener <workflow_using-events>`
- :ref:`AsEnterListener <workflow_using-events>`
- :ref:`AsEnteredListener <workflow_using-events>`
- :ref:`AsGuardListener <workflow_using-events>`
- :ref:`AsLeaveListener <workflow_using-events>`
- :ref:`AsTransitionListener <workflow_using-events>`