Skip to content

Commit af92684

Browse files
[Serializer] Fixed occurence of an old FQCN notation
1 parent 912c548 commit af92684

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: components/serializer.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ when this happens, set the ``AbstractNormalizer::ALLOW_EXTRA_ATTRIBUTES`` contex
174174
``false`` and provide an object that implements ``ClassMetadataFactoryInterface``
175175
when constructing the normalizer::
176176

177+
use App\Model\Person;
178+
177179
$data = <<<EOF
178180
<person>
179181
<name>foo</name>
@@ -189,7 +191,7 @@ when constructing the normalizer::
189191

190192
// this will throw a Symfony\Component\Serializer\Exception\ExtraAttributesException
191193
// because "city" is not an attribute of the Person class
192-
$person = $serializer->deserialize($data, 'App\Model\Person', 'xml', [
194+
$person = $serializer->deserialize($data, Person::class, 'xml', [
193195
AbstractNormalizer::ALLOW_EXTRA_ATTRIBUTES => false,
194196
]);
195197

0 commit comments

Comments
 (0)