Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5e6d3b0

Browse filesBrowse files
committed
Minor tweaks
1 parent dd3a32e commit 5e6d3b0
Copy full SHA for 5e6d3b0

File tree

Expand file treeCollapse file tree

1 file changed

+5
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-8
lines changed

‎serializer.rst

Copy file name to clipboardExpand all lines: serializer.rst
+5-8Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,8 @@ normalizers (in order of priority):
13521352
This denormalizer converts an array of arrays to an array of objects
13531353
(with the given type). See :ref:`Handling Arrays <serializer-handling-arrays>`.
13541354

1355-
ByUsing the PropertyInfoExtractor you can simply annotate the arrays by '@var Person[]'
1355+
Use :class:`Symfony\\Component\\PropertyInfo\\PropertyInfoExtractor` to provide
1356+
hints with annotations like ``@var Person[]``:
13561357

13571358
.. configuration-block::
13581359

@@ -1367,13 +1368,9 @@ normalizers (in order of priority):
13671368
use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
13681369
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
13691370
use Symfony\Component\Serializer\Serializer;
1370-
1371-
$reflectionExtractor = new ReflectionExtractor();
1372-
$phpDocExtractor = new PhpDocExtractor();
1373-
$propertyInfo = new PropertyInfoExtractor([], [$phpDocExtractor, $reflectionExtractor]);
1374-
1375-
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());
1376-
$normalizers = [new ObjectNormalizer($classMetadataFactory, null, null, $propertyInfo), new ArrayDenormalizer()];
1371+
1372+
$propertyInfo = new PropertyInfoExtractor([], [new PhpDocExtractor(), new ReflectionExtractor()]);
1373+
$normalizers = [new ObjectNormalizer(new ClassMetadataFactory(new AttributeLoader()), null, null, $propertyInfo), new ArrayDenormalizer()];
13771374
13781375
$this->serializer = new Serializer($normalizers, [new JsonEncoder()]);
13791376

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.