Skip to content

Commit 657d2b6

Browse files
committed
Merge branch '4.2' into 4.3
* 4.2: Remove chrome debug since it's no longer present Fix several typos [#11635] Fixed syntax 11627 Minor/Patch version fix edit normalizer deprecated method on 4.2
2 parents 89bb24b + a961c40 commit 657d2b6

File tree

4 files changed

+47
-22
lines changed

4 files changed

+47
-22
lines changed

components/serializer.rst

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ When serializing, you can set a callback to format a specific object property::
655655
$encoder = new JsonEncoder();
656656

657657
// all callback parameters are optional (you can omit the ones you don't use)
658-
$callback = function ($innerObject, $outerObject, string $attributeName, string $format = null, array $context = []) {
658+
$dateCallback = function ($innerObject, $outerObject, string $attributeName, string $format = null, array $context = []) {
659659
return $innerObject instanceof \DateTime ? $innerObject->format(\DateTime::ISO8601) : '';
660660
};
661661

@@ -677,6 +677,11 @@ When serializing, you can set a callback to format a specific object property::
677677
$serializer->serialize($person, 'json');
678678
// Output: {"name":"cordoval", "age": 34, "createdAt": "2014-03-22T09:43:12-0500"}
679679

680+
.. deprecated:: 4.2
681+
682+
The :method:`Symfony\\Component\\Serializer\\Normalizer\\AbstractNormalizer::setCallbacks` is deprecated since
683+
Symfony 4.2, use the "callbacks" key of the context instead.
684+
680685
.. _component-serializer-normalizers:
681686

682687
Normalizers
@@ -947,15 +952,9 @@ when such a case is encountered::
947952

948953
echo $serializer->serialize($organization, 'json'); // Throws a CircularReferenceException
949954

950-
The ``setCircularReferenceLimit()`` method of this normalizer sets the number
951-
of times it will serialize the same object before considering it a circular
952-
reference. Its default value is ``1``.
953-
954-
.. deprecated:: 4.2
955-
956-
The :method:`Symfony\\Component\\Serializer\\Normalizer\\AbstractNormalizer::setCircularReferenceHandler`
957-
method is deprecated since Symfony 4.2. Use the ``circular_reference_handler``
958-
key of the context instead.
955+
The key ``circular_reference_limit`` in the default context sets the number of
956+
times it will serialize the same object before considering it a circular
957+
reference. The default value is ``1``.
959958

960959
Instead of throwing an exception, circular references can also be handled
961960
by custom callables. This is especially useful when serializing entities
@@ -973,6 +972,12 @@ having unique identifiers::
973972
var_dump($serializer->serialize($org, 'json'));
974973
// {"name":"Les-Tilleuls.coop","members":[{"name":"K\u00e9vin", organization: "Les-Tilleuls.coop"}]}
975974

975+
.. deprecated:: 4.2
976+
977+
The :method:`Symfony\\Component\\Serializer\\Normalizer\\AbstractNormalizer::setCircularReferenceHandler`
978+
method is deprecated since Symfony 4.2. Use the ``circular_reference_handler``
979+
key of the context instead.
980+
976981
Handling Serialization Depth
977982
----------------------------
978983

@@ -1100,11 +1105,16 @@ having unique identifiers::
11001105
$level2->child = $level3;
11011106

11021107
$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
1103-
$normalizer = new ObjectNormalizer($classMetadataFactory);
1108+
11041109
// all callback parameters are optional (you can omit the ones you don't use)
1105-
$normalizer->setMaxDepthHandler(function ($innerObject, $outerObject, string $attributeName, string $format = null, array $context = []) {
1110+
$maxDepthHandler = function ($innerObject, $outerObject, string $attributeName, string $format = null, array $context = []) {
11061111
return '/foos/'.$innerObject->id;
1107-
});
1112+
};
1113+
1114+
$defaultContext = [
1115+
AbstractObjectNormalizer::MAX_DEPTH_HANDLER => $maxDepthHandler,
1116+
];
1117+
$normalizer = new ObjectNormalizer($classMetadataFactory, null, null, null, null, null, $defaultContext);
11081118

11091119
$serializer = new Serializer([$normalizer]);
11101120

@@ -1119,6 +1129,12 @@ having unique identifiers::
11191129
];
11201130
*/
11211131

1132+
.. deprecated:: 4.2
1133+
1134+
The :method:`Symfony\\Component\\Serializer\\Normalizer\\AbstractNormalizer::setMaxDepthHandler`
1135+
method is deprecated since Symfony 4.2. Use the ``max_depth_handler``
1136+
key of the context instead.
1137+
11221138
Handling Arrays
11231139
---------------
11241140

reference/forms/types/integer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ scale
9696

9797
This specifies how many decimals will be allowed until the field rounds the
9898
submitted value (via ``rounding_mode``). This option inherits from
99-
:doc:`number </reference/forms/types/number>` type and is overriden to ``0`` for
99+
:doc:`number </reference/forms/types/number>` type and is overridden to ``0`` for
100100
``IntegerType``.
101101

102102
Inherited Options

setup/upgrade_minor.rst

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ There are two steps to upgrading a minor version:
2121
1) Update the Symfony Library via Composer
2222
------------------------------------------
2323

24-
Your ``composer.json`` file should already be configured to allow your Symfony
25-
packages to be upgraded to minor versions. But, if a package was not upgraded,
26-
check that the version constrains of your Symfony dependencies are like this:
24+
The ``composer.json`` file is configured to allow Symfony packages to be
25+
upgraded to patch versions. But, if you would like the packages to be upgraded
26+
to minor versions, check that the version constrains of the Symfony dependencies
27+
are like this:
2728

2829
.. code-block:: json
2930
@@ -42,6 +43,19 @@ check that the version constrains of your Symfony dependencies are like this:
4243
"...": "...",
4344
}
4445
46+
At the bottom of your ``composer.json`` file, in the ``extra`` block you can
47+
find a data setting for the symfony version. Make sure to also upgrade
48+
this one. For instance, update it to ``4.3.*`` to upgrade to Symfony 4.3:
49+
50+
.. code-block:: json
51+
52+
"extra": {
53+
"symfony": {
54+
"allow-contrib": false,
55+
"require": "4.3.*"
56+
}
57+
}
58+
4559
Next, use Composer to download new versions of the libraries:
4660

4761
.. code-block:: terminal

web_link.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ the priority of the resource to download using the ``importance`` attribute:
7979
<link rel="stylesheet" href="{{ preload('/app.css', { as: 'style', importance: 'low' }) }}">
8080
</head>
8181

82-
.. tip::
83-
84-
Google Chrome provides an interface to debug HTTP/2 connections. Browse
85-
``chrome://net-internals/#http2`` to see all the details.
86-
8782
How does it work?
8883
~~~~~~~~~~~~~~~~~
8984

0 commit comments

Comments
 (0)