Remove mentions of AnnotationLoader

This commit is contained in:
Alexandre Daubois
2023-09-05 11:15:20 +02:00
parent 18ff87a8e2
commit d7717fb4ea
3 changed files with 0 additions and 89 deletions

View File

@@ -1,19 +0,0 @@
.. note::
In order to use the annotation loader, you should have installed the
``doctrine/annotations`` and ``doctrine/cache`` packages with Composer.
.. tip::
Annotation classes aren't loaded automatically, so you must load them
using a class loader like this::
use Composer\Autoload\ClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;
/** @var ClassLoader $loader */
$loader = require __DIR__.'/../vendor/autoload.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View File

@@ -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
-------------------

View File

@@ -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
.................
@@ -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
.................