Skip to content

Commit 2b378e2

Browse files
Merge branch '7.4' into mailtrap-sandbox7.4
2 parents cface15 + 6b6a678 commit 2b378e2

File tree

16 files changed

+175
-126
lines changed

16 files changed

+175
-126
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center"><a href="https://symfony.com" target="_blank">
2-
<img src="https://symfony.com/logos/symfony_black_02.svg">
2+
<img src="https://symfony.com/logos/symfony_dynamic_01.svg" alt="Symfony Logo">
33
</a></p>
44

55
<h3 align="center">

bundles/best_practices.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ the ``tests/`` directory. Tests should follow the following principles:
188188
.. note::
189189

190190
A test suite must not contain ``AllTests.php`` scripts, but must rely on the
191-
existence of a ``phpunit.xml.dist`` file.
191+
existence of a ``phpunit.dist.xml`` file.
192192

193193
Continuous Integration
194194
----------------------

components/cache/adapters/redis_adapter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Redis Cache Adapter
99
article if you are using it in a Symfony application.
1010

1111
This adapter stores the values in-memory using one (or more) `Redis server`_
12-
of `Valkey`_ server instances.
12+
or `Valkey`_ server instances.
1313

1414
Unlike the :doc:`APCu adapter </components/cache/adapters/apcu_adapter>`, and similarly to the
1515
:doc:`Memcached adapter </components/cache/adapters/memcached_adapter>`, it is not limited to the current server's

contributing/code/bc.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ Make final No
285285
Move to parent class Yes
286286
:ref:`Add argument without a default value <add-argument-public-method>` No
287287
:ref:`Add argument with a default value <add-argument-public-method>` No :ref:`[7] <note-7>` :ref:`[8] <note-8>`
288+
Rename argument Yes :ref:`[10] <note-10>`
288289
Remove argument No :ref:`[3] <note-3>`
289290
Add default value to an argument No :ref:`[7] <note-7>` :ref:`[8] <note-8>`
290291
Remove default value of an argument No
@@ -304,6 +305,7 @@ Make public No
304305
Move to parent class Yes
305306
:ref:`Add argument without a default value <add-argument-public-method>` No
306307
:ref:`Add argument with a default value <add-argument-public-method>` No :ref:`[7] <note-7>` :ref:`[8] <note-8>`
308+
Rename argument Yes :ref:`[10] <note-10>`
307309
Remove argument No :ref:`[3] <note-3>`
308310
Add default value to an argument No :ref:`[7] <note-7>` :ref:`[8] <note-8>`
309311
Remove default value of an argument No :ref:`[7] <note-7>`
@@ -320,6 +322,7 @@ Change name Yes
320322
Make public or protected Yes
321323
Add argument without a default value Yes
322324
Add argument with a default value Yes
325+
Rename argument Yes
323326
Remove argument Yes
324327
Add default value to an argument Yes
325328
Remove default value of an argument Yes

create_framework/unit_testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using `PHPUnit`_. At first, install PHPUnit as a development dependency:
1414
1515
$ composer require --dev phpunit/phpunit:^11.0
1616
17-
Then, create a PHPUnit configuration file in ``example.com/phpunit.xml.dist``:
17+
Then, create a PHPUnit configuration file in ``example.com/phpunit.dist.xml``:
1818

1919
.. code-block:: xml
2020

mailer.rst

Lines changed: 103 additions & 94 deletions
Large diffs are not rendered by default.

routing.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,10 @@ given value:
279279
.. code-block:: yaml
280280
281281
# config/routes.yaml
282-
tools:
283-
path: /tools
284-
controller: App\Controller\DefaultController::developerTools
285-
env: dev
282+
when@dev:
283+
tools:
284+
path: /tools
285+
controller: App\Controller\DefaultController::developerTools
286286
287287
.. code-block:: xml
288288
@@ -293,9 +293,9 @@ given value:
293293
xsi:schemaLocation="http://symfony.com/schema/routing
294294
https://symfony.com/schema/routing/routing-1.0.xsd">
295295
296-
<route id="tools" path="/tools" controller="App\Controller\DefaultController::developerTools">
297-
<env>dev</env>
298-
</route>
296+
<when env="dev">
297+
<route id="tools" path="/tools" controller="App\Controller\DefaultController::developerTools"/>
298+
</when>
299299
</routes>
300300
301301
.. code-block:: php
@@ -305,10 +305,11 @@ given value:
305305
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
306306
307307
return function (RoutingConfigurator $routes): void {
308-
$routes->add('tools', '/tools')
309-
->controller([DefaultController::class, 'developerTools'])
310-
->env('dev')
311-
;
308+
if('dev' === $routes->env()) {
309+
$routes->add('tools', '/tools')
310+
->controller([DefaultController::class, 'developerTools'])
311+
;
312+
}
312313
};
313314
314315
.. _routing-matching-expressions:

serializer.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,10 +1476,14 @@ normalizers (in order of priority):
14761476
to read and write in the object. This allows it to access properties
14771477
directly or using getters, setters, hassers, issers, canners, adders and
14781478
removers. Names are generated by removing the ``get``, ``set``,
1479-
``has``, ``is``, ``add`` or ``remove`` prefix from the method name and
1479+
``has``, ``is``, ``can``, ``add`` or ``remove`` prefix from the method name and
14801480
transforming the first letter to lowercase (e.g. ``getFirstName()`` ->
14811481
``firstName``).
14821482

1483+
.. versionadded:: 7.4
1484+
1485+
Support for the ``can`` prefix was introduced in Symfony 7.4.
1486+
14831487
During denormalization, it supports using the constructor as well as
14841488
the discovered methods.
14851489

serializer/encoders.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ These are the options available on the :ref:`serializer context <serializer-cont
205205
``cdata_wrapping_pattern`` (default: ``/[<>&]/``)
206206
A regular expression pattern to determine if a value should be wrapped
207207
in a CDATA section.
208+
``cdata_wrapping_name_pattern`` (default: ``false``)
209+
A regular expression pattern that defines the names of fields whose values
210+
should always be wrapped in a CDATA section, even if their contents don't
211+
require it. Example: ``'/(firstname|lastname)/'``
208212
``ignore_empty_attributes`` (default: ``false``)
209213
If set to true, ignores all attributes with empty values in the generated XML
210214

@@ -216,6 +220,10 @@ These are the options available on the :ref:`serializer context <serializer-cont
216220

217221
The ``ignore_empty_attributes`` option was introduced in Symfony 7.3.
218222

223+
.. versionadded:: 7.4
224+
225+
The ``cdata_wrapping_name_pattern`` option was introduced in Symfony 7.4.
226+
219227
Example with a custom ``context``::
220228

221229
use Symfony\Component\Serializer\Encoder\XmlEncoder;

serializer/streaming_json.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,16 @@ When callables are not enough, you can use a service implementing the
541541
The ``getStreamValueType()`` method must return the value's type as it will
542542
appear in the JSON stream.
543543

544+
.. tip::
545+
546+
The ``$options`` argument of the ``transform()`` method includes a special
547+
option called ``_current_object`` which gives access to the object holding
548+
the current property (or ``null`` if there's none).
549+
550+
.. versionadded:: 7.4
551+
552+
The ``_current_object`` option was introduced in Symfony 7.4.
553+
544554
To use this transformer in a class, configure the ``#[ValueTransformer]`` attribute::
545555

546556
// src/Dto/Dog.php

0 commit comments

Comments
 (0)