Skip to content

Commit 6925804

Browse files
committed
Merge branch '4.2' into 4.3
* 4.2: Fix several typos [#11635] Fixed syntax 11627 Minor/Patch version fix edit normalizer deprecated method on 4.2
2 parents 524881b + cf9b393 commit 6925804

File tree

7 files changed

+51
-21
lines changed

7 files changed

+51
-21
lines changed

cache.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ Clearing the Cache
594594
------------------
595595

596596
To clear the cache you can use the ``bin/console cache:pool:clear [pool]`` command.
597-
That will remove all the entries from your storage and you wil have to recalculate
597+
That will remove all the entries from your storage and you will have to recalculate
598598
all values. You can also group your pools into "cache clearers". There are 3 cache
599599
clearers by default:
600600

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

components/var_dumper/advanced.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ method to use a light theme::
188188

189189
The :class:`Symfony\\Component\\VarDumper\\Dumper\\HtmlDumper` limits string
190190
length and nesting depth of the output to make it more readable. These options
191-
can be overriden by the third optional parameter of the
191+
can be overridden by the third optional parameter of the
192192
:method:`dump(Data $data) <Symfony\\Component\\VarDumper\\Dumper\\DataDumperInterface::dump>`
193193
method::
194194

reference/forms/types/hidden.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The hidden type represents a hidden input field.
99
+-------------+----------------------------------------------------------------------+
1010
| Rendered as | ``input`` ``hidden`` field |
1111
+-------------+----------------------------------------------------------------------+
12-
| Overriden | - `compound`_ |
12+
| Overridden | - `compound`_ |
1313
| options | - `error_bubbling`_ |
1414
| | - `required`_ |
1515
+-------------+----------------------------------------------------------------------+

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

testing/profiling.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ provided by the collectors obtained through the ``$client->getProfile()`` call::
105105

106106
If a test fails because of profiling data (too many DB queries for instance),
107107
you might want to use the Web Profiler to analyze the request after the tests
108-
finish. It can be achived by embedding the token in the error message::
108+
finish. It can be achieved by embedding the token in the error message::
109109

110110
$this->assertLessThan(
111111
30,

0 commit comments

Comments
 (0)