Skip to content

Remove mentions of AnnotationLoader #18826

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

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions _includes/_annotation_loader_tip.rst.inc

This file was deleted.

46 changes: 0 additions & 46 deletions components/validator/resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,52 +83,6 @@ configure the locations of these files::
:method:`Symfony\\Component\\Validator\\ValidatorBuilder::addXmlMappings`
to configure an array of file paths.

The AnnotationLoader
--------------------

.. deprecated:: 6.4

The :class:`Symfony\\Component\\Validator\\Mapping\\Loader\\AnnotationLoader`
is deprecated since Symfony 6.4, use the
:class:`Symfony\\Component\\Validator\\Mapping\\Loader\\AttributeLoader`
instead.

The component provides an
:class:`Symfony\\Component\\Validator\\Mapping\\Loader\\AnnotationLoader` to get
the metadata from the attributes of the class::

use Symfony\Component\Validator\Constraints as Assert;
// ...

class User
{
#[Assert\NotBlank]
protected string $name;
}

To enable the annotation loader, call the
:method:`Symfony\\Component\\Validator\\ValidatorBuilder::enableAnnotationMapping` method::

use Symfony\Component\Validator\Validation;

$validator = Validation::createValidatorBuilder()
->enableAnnotationMapping()
->getValidator();

To disable the annotation loader after it was enabled, call
:method:`Symfony\\Component\\Validator\\ValidatorBuilder::disableAnnotationMapping`.

.. deprecated:: 6.4

The :method:`Symfony\\Component\\Validator\\ValidatorBuilder::enableAnnotationMapping`
and :method:`Symfony\\Component\\Validator\\ValidatorBuilder::disableAnnotationMapping`
methods are deprecated since Symfony 6.4, use the
:method:`Symfony\\Component\\Validator\\ValidatorBuilder::enableAttributeMapping`
and :method:`Symfony\\Component\\Validator\\ValidatorBuilder::disableAttributeMapping`
methods instead.

.. include:: /_includes/_annotation_loader_tip.rst.inc

The AttributeLoader
-------------------

Expand Down
24 changes: 0 additions & 24 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2701,18 +2701,6 @@ settings is configured.

.. _reference-validation-enable_annotations:

enable_annotations
..................

**type**: ``boolean`` **default**: ``true``

If this option is enabled, validation constraints can be defined using annotations or `PHP attributes`_.

.. deprecated:: 6.4

This option is deprecated since Symfony 6.4, use the ``enable_attributes``
option instead.

enable_attributes
.................

Expand Down Expand Up @@ -2899,18 +2887,6 @@ Whether to enable the ``serializer`` service or not in the service container.

.. _reference-serializer-enable_annotations:

enable_annotations
..................

**type**: ``boolean`` **default**: ``true``

If this option is enabled, serialization groups can be defined using annotations or attributes.

.. deprecated:: 6.4

This option is deprecated since Symfony 6.4, use the ``enable_attributes``
option instead.

enable_attributes
.................

Expand Down