From ca5e2e0acca85b57feefdd4e1ea4f38a3d5c5beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 10 Sep 2018 21:41:30 +0200 Subject: [PATCH 1/3] [Serializer] Allow to access extra infos in name converters --- components/serializer.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/serializer.rst b/components/serializer.rst index af35afdadc4..e08de3eb7ac 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -481,6 +481,9 @@ and :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`:: $companyCopy = $serializer->deserialize($json, Company::class, 'json'); // Same data as $company +It is also possible to access to the current class name, format and context by implementing the +:class:`Symfony\\Component\\Serializer\\NameConverter\\AdvancedNameConverterInterface` interface. + .. _using-camelized-method-names-for-underscored-attributes: CamelCase to snake_case From ae63f8a2bb3423ee7e9066f8283c69ce1a086da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 10 Sep 2018 21:46:50 +0200 Subject: [PATCH 2/3] Add a note block --- components/serializer.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/serializer.rst b/components/serializer.rst index e08de3eb7ac..a81689d9965 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -481,8 +481,11 @@ and :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`:: $companyCopy = $serializer->deserialize($json, Company::class, 'json'); // Same data as $company -It is also possible to access to the current class name, format and context by implementing the -:class:`Symfony\\Component\\Serializer\\NameConverter\\AdvancedNameConverterInterface` interface. +.. note:: + + Since Symfony 4.2, it is also possible to access to the current class name, format and + context by implementing the :class:`Symfony\\Component\\Serializer\\NameConverter\\AdvancedNameConverterInterface` + interface. .. _using-camelized-method-names-for-underscored-attributes: From 71afdca6dca6f6557ffc840357fe6eaf1d5102d0 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 11 Sep 2018 09:44:22 +0200 Subject: [PATCH 3/3] Minor reword --- components/serializer.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/serializer.rst b/components/serializer.rst index a81689d9965..512ef037609 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -483,9 +483,12 @@ and :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`:: .. note:: - Since Symfony 4.2, it is also possible to access to the current class name, format and - context by implementing the :class:`Symfony\\Component\\Serializer\\NameConverter\\AdvancedNameConverterInterface` - interface. + You can also implement + :class:`Symfony\\Component\\Serializer\\NameConverter\\AdvancedNameConverterInterface` + to access to the current class name, format and context. + + .. versionadded:: 4.2 + The ``AdvancedNameConverterInterface`` interface was introduced in Symfony 4.2. .. _using-camelized-method-names-for-underscored-attributes: