Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c734d36

Browse files
authoredApr 22, 2025··
Merge branch 'symfony:7.3' into patch-1
2 parents 040b819 + ff88904 commit c734d36

File tree

107 files changed

+2499
-567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+2499
-567
lines changed
 

‎components/clock.rst‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,36 @@ timestamps::
267267
:method:`Symfony\\Component\\Clock\\DatePoint::getMicrosecond` methods were
268268
introduced in Symfony 7.1.
269269

270+
Storing DatePoints in the Database
271+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
272+
273+
If you :doc:`use Doctrine </doctrine>` to work with databases, consider using the
274+
``date_point`` Doctrine type, which converts to/from ``DatePoint`` objects automatically::
275+
276+
// src/Entity/Product.php
277+
namespace App\Entity;
278+
279+
use Doctrine\ORM\Mapping as ORM;
280+
use Symfony\Component\Clock\DatePoint;
281+
282+
#[ORM\Entity]
283+
class Product
284+
{
285+
// if you don't define the Doctrine type explicitly, Symfony will autodetect it:
286+
#[ORM\Column]
287+
private DatePoint $createdAt;
288+
289+
// if you prefer to define the Doctrine type explicitly:
290+
#[ORM\Column(type: 'date_point')]
291+
private DatePoint $updatedAt;
292+
293+
// ...
294+
}
295+
296+
.. versionadded:: 7.3
297+
298+
The ``DatePointType`` was introduced in Symfony 7.3.
299+
270300
.. _clock_writing-tests:
271301

272302
Writing Time-Sensitive Tests

‎components/config/definition.rst‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,25 @@ The configuration can now be written like this::
186186
->end()
187187
;
188188

189+
You can also use the ``enumClass()`` method to pass the FQCN of an enum
190+
class to the node. This will automatically set the values of the node to
191+
the cases of the enum::
192+
193+
$rootNode
194+
->children()
195+
->enumNode('delivery')
196+
->enumClass(Delivery::class)
197+
->end()
198+
->end()
199+
;
200+
201+
When using a backed enum, the values provided to the node will be cast
202+
to one of the enum cases if possible.
203+
204+
.. versionadded:: 7.3
205+
206+
The ``enumClass()`` method was introduced in Symfony 7.3.
207+
189208
Array Nodes
190209
~~~~~~~~~~~
191210

@@ -527,6 +546,30 @@ and in XML:
527546
<!-- entries-per-page: This value is only used for the search results page. -->
528547
<config entries-per-page="25"/>
529548
549+
You can also provide a URL to a full documentation page::
550+
551+
$rootNode
552+
->docUrl('Full documentation is available at https://example.com/docs/{version:major}.{version:minor}/reference.html')
553+
->children()
554+
->integerNode('entries_per_page')
555+
->defaultValue(25)
556+
->end()
557+
->end()
558+
;
559+
560+
A few placeholders are available to customize the URL:
561+
562+
* ``{version:major}``: The major version of the package currently installed
563+
* ``{version:minor}``: The minor version of the package currently installed
564+
* ``{package}``: The name of the package
565+
566+
The placeholders will be replaced when printing the configuration tree with the
567+
``config:dump-reference`` command.
568+
569+
.. versionadded:: 7.3
570+
571+
The ``docUrl()`` method was introduced in Symfony 7.3.
572+
530573
Optional Sections
531574
-----------------
532575

@@ -815,6 +858,7 @@ A validation rule always has an "if" part. You can specify this part in
815858
the following ways:
816859

817860
- ``ifTrue()``
861+
- ``ifFalse()``
818862
- ``ifString()``
819863
- ``ifNull()``
820864
- ``ifEmpty()``
@@ -833,6 +877,10 @@ A validation rule also requires a "then" part:
833877
Usually, "then" is a closure. Its return value will be used as a new value
834878
for the node, instead of the node's original value.
835879

880+
.. versionadded:: 7.3
881+
882+
The ``ifFalse()`` method was introduced in Symfony 7.3.
883+
836884
Configuring the Node Path Separator
837885
-----------------------------------
838886

‎components/console/helpers/formatterhelper.rst‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,16 @@ Sometimes you want to format seconds to time. This is possible with the
129129
The first argument is the seconds to format and the second argument is the
130130
precision (default ``1``) of the result::
131131

132-
Helper::formatTime(42); // 42 secs
133-
Helper::formatTime(125); // 2 mins
134-
Helper::formatTime(125, 2); // 2 mins, 5 secs
135-
Helper::formatTime(172799, 4); // 1 day, 23 hrs, 59 mins, 59 secs
132+
Helper::formatTime(0.001); // 1 ms
133+
Helper::formatTime(42); // 42 s
134+
Helper::formatTime(125); // 2 min
135+
Helper::formatTime(125, 2); // 2 min, 5 s
136+
Helper::formatTime(172799, 4); // 1 d, 23 h, 59 min, 59 s
137+
Helper::formatTime(172799.056, 5); // 1 d, 23 h, 59 min, 59 s, 56 ms
138+
139+
.. versionadded:: 7.3
140+
141+
Support for formatting up to milliseconds was introduced in Symfony 7.3.
136142

137143
Formatting Memory
138144
-----------------

‎components/console/helpers/map.rst.inc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
* :doc:`/components/console/helpers/progressbar`
44
* :doc:`/components/console/helpers/questionhelper`
55
* :doc:`/components/console/helpers/table`
6+
* :doc:`/components/console/helpers/tree`
67
* :doc:`/components/console/helpers/debug_formatter`
78
* :doc:`/components/console/helpers/cursor`

0 commit comments

Comments
 (0)
Please sign in to comment.