Skip to content

[PropertyInfo][Serializer] Remove AnnotationLoader #19080

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
Oct 24, 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
1 change: 1 addition & 0 deletions _build/redirection_map
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@
/components https://symfony.com/components
/components/index https://symfony.com/components
/serializer/normalizers /components/serializer#normalizers
/components/serializer#component-serializer-attributes-groups-annotations /components/serializer#component-serializer-attributes-groups-attributes
/logging/monolog_regex_based_excludes /logging/monolog_exclude_http_codes
/security/named_encoders /security/named_hashers
/components/inflector /components/string#inflector
Expand Down
14 changes: 0 additions & 14 deletions components/property_info.rst
Original file line number Diff line number Diff line change
Expand Up @@ -468,20 +468,6 @@ with the ``property_info`` service in the Symfony Framework::
// the `serializer_groups` option must be configured (may be set to null)
$serializerExtractor->getProperties($class, ['serializer_groups' => ['mygroup']]);

.. versionadded:: 6.4

The
:class:`Symfony\\Component\\Serializer\\Mapping\\Loader\\AttributeLoader`
was introduced in Symfony 6.4. Prior to this, the
:class:`Symfony\\Component\\Serializer\\Mapping\\Loader\\AnnotationLoader`
must be used.

.. deprecated:: 6.4

The
:class:`Symfony\\Component\\Serializer\\Mapping\\Loader\\AnnotationLoader`
was deprecated in Symfony 6.4.

If ``serializer_groups`` is set to ``null``, serializer groups metadata won't be
checked but you will get only the properties considered by the Serializer
Component (notably the ``#[Ignore]`` attribute is taken into account).
Expand Down
24 changes: 0 additions & 24 deletions components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,6 @@ that will be used by the normalizer must be aware of the format to use.
The following code shows how to initialize the :class:`Symfony\\Component\\Serializer\\Mapping\\Factory\\ClassMetadataFactory`
for each format:

* Annotations in PHP files::

use Doctrine\Common\Annotations\AnnotationReader;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;

$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));

* Attributes in PHP files::

use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
Expand All @@ -300,22 +292,6 @@ for each format:

$classMetadataFactory = new ClassMetadataFactory(new XmlFileLoader('/path/to/your/definition.xml'));

.. versionadded:: 6.4

The
:class:`Symfony\\Component\\Serializer\\Mapping\\Loader\\AttributeLoader`
was introduced in Symfony 6.4. Prior to this, the
:class:`Symfony\\Component\\Serializer\\Mapping\\Loader\\AnnotationLoader`
must be used.

.. deprecated:: 6.4

Reading annotations in PHP files is deprecated since Symfony 6.4.
Also, the
:class:`Symfony\\Component\\Serializer\\Mapping\\Loader\\AnnotationLoader`
was deprecated in Symfony 6.4.

.. _component-serializer-attributes-groups-annotations:
.. _component-serializer-attributes-groups-attributes:

Then, create your groups definition:
Expand Down