Skip to content

Commit df280a4

Browse files
authored
Merge branch 'symfony:6.4' into Chris53897-patch-1
2 parents 98bb452 + 80f7c9e commit df280a4

Some content is hidden

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

57 files changed

+917
-187
lines changed
Loading

best_practices.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,12 @@ nothing more than a few lines of *glue-code*, so you are not coupling the
224224
important parts of your application.
225225

226226
.. _best-practice-controller-annotations:
227+
.. _best-practice-controller-attributes:
227228

228-
Use Attributes or Annotations to Configure Routing, Caching, and Security
229-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
229+
Use Attributes to Configure Routing, Caching, and Security
230+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230231

231-
Using attributes or annotations for routing, caching, and security simplifies
232+
Using attributes for routing, caching, and security simplifies
232233
configuration. You don't need to browse several files created with different
233234
formats (YAML, XML, PHP): all the configuration is just where you require it,
234235
and it only uses one format.

bundles/best_practices.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ Event Listeners ``src/EventListener/``
123123
Configuration (routes, services, etc.) ``config/``
124124
Web Assets (CSS, JS, images) ``public/``
125125
Translation files ``translations/``
126-
Validation (when not using annotations) ``config/validation/``
127-
Serialization (when not using annotations) ``config/serialization/``
126+
Validation (when not using attributes) ``config/validation/``
127+
Serialization (when not using attributes) ``config/serialization/``
128128
Templates ``templates/``
129129
Unit and Functional Tests ``tests/``
130130
=================================================== ========================================
@@ -163,7 +163,7 @@ If the bundle includes Doctrine ORM entities and/or ODM documents, it's
163163
recommended to define their mapping using XML files stored in
164164
``config/doctrine/``. This allows to override that mapping using the
165165
:doc:`standard Symfony mechanism to override bundle parts </bundles/override>`.
166-
This is not possible when using annotations/attributes to define the mapping.
166+
This is not possible when using attributes to define the mapping.
167167

168168
Tests
169169
-----

components/browser_kit.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,28 @@ provides access to the link properties (e.g. ``$link->getMethod()``,
112112
$link = $crawler->selectLink('Go elsewhere...')->link();
113113
$client->click($link);
114114

115+
The :method:`Symfony\\Component\\BrowserKit\\AbstractBrowser::click` and
116+
:method:`Symfony\\Component\\BrowserKit\\AbstractBrowser::clickLink` methods
117+
can take an optional ``serverParameters`` argument. This
118+
parameter allows to send additional information like headers when clicking
119+
on a link::
120+
121+
use Acme\Client;
122+
123+
$client = new Client();
124+
$client->request('GET', '/product/123');
125+
126+
// works both with `click()`...
127+
$link = $crawler->selectLink('Go elsewhere...')->link();
128+
$client->click($link, ['X-Custom-Header' => 'Some data']);
129+
130+
// ... and `clickLink()`
131+
$crawler = $client->clickLink('Go elsewhere...', ['X-Custom-Header' => 'Some data']);
132+
133+
.. versionadded:: 6.4
134+
135+
The ``serverParameters`` parameter was introduced in Symfony 6.4.
136+
115137
Submitting Forms
116138
~~~~~~~~~~~~~~~~
117139

components/config/resources.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ an array containing all matches.
3030
Resource Loaders
3131
----------------
3232

33-
For each type of resource (YAML, XML, annotation, etc.) a loader must be
33+
For each type of resource (YAML, XML, attributes, etc.) a loader must be
3434
defined. Each loader should implement
3535
:class:`Symfony\\Component\\Config\\Loader\\LoaderInterface` or extend the
3636
abstract :class:`Symfony\\Component\\Config\\Loader\\FileLoader` class,

components/console/events.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,18 @@ Symfony doesn't handle any signal received by the command (not even ``SIGKILL``,
243243
``SIGTERM``, etc). This behavior is intended, as it gives you the flexibility to
244244
handle all signals e.g. to do some tasks before terminating the command.
245245

246+
.. tip::
247+
248+
If you need to fetch the signal name from its integer value (e.g. for logging),
249+
you can use the
250+
:method:`Symfony\\Component\\Console\\SignalRegistry\\SignalMap::getSignalName`
251+
method.
252+
253+
.. versionadded:: 6.4
254+
255+
The :class:`Symfony\\Component\\Console\\SignalRegistry\\SignalMap` class was
256+
introduced in Symfony 6.4.
257+
246258
.. deprecated:: 6.3
247259

248260
In Symfony versions previous to 6.3, all signals (except ``SIGUSR1`` and

components/dom_crawler.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,18 @@ Access the attribute value of the first node of the current selection::
238238

239239
$class = $crawler->filterXPath('//body/p')->attr('class');
240240

241+
.. tip::
242+
243+
You can define the default value to use if the node or attribute is empty
244+
by using the second argument of the ``attr()`` method::
245+
246+
$class = $crawler->filterXPath('//body/p')->attr('class', 'my-default-class');
247+
248+
.. versionadded:: 6.4
249+
250+
The possibility to specify a default value to the ``attr()`` method
251+
was introduced in Symfony 6.4.
252+
241253
Extract attribute and/or node values from the list of nodes::
242254

243255
$attributes = $crawler

components/http_kernel.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,13 @@ on the request's information.
263263
is passed to it. This step is also specific to the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver`
264264
sub-class used by the Symfony Framework.
265265

266+
.. deprecated:: 6.4
267+
268+
:class:`Symfony\\Component\\DependencyInjection\\ContainerAwareInterface` and
269+
:class:`Symfony\\Component\\DependencyInjection\\ContainerAwareTrait` are
270+
deprecated since Symfony 6.4. Dependency injection should be used instead to
271+
access the service container.
272+
266273
.. _component-http-kernel-kernel-controller:
267274

268275
3) The ``kernel.controller`` Event

components/intl.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,41 @@ You may convert codes between two-letter alpha2 and three-letter alpha3 codes::
179179

180180
$alpha2Code = Countries::getAlpha2Code($alpha3Code);
181181

182+
Numeric Country Codes
183+
~~~~~~~~~~~~~~~~~~~~~
184+
185+
The `ISO 3166-1 numeric`_ standard defines three-digit country codes to represent
186+
countries, dependent territories, and special areas of geographical interest.
187+
188+
The main advantage over the ISO 3166-1 alphabetic codes (alpha-2 and alpha-3) is
189+
that these numeric codes are independent from the writing system. The alphabetic
190+
codes use the 26-letter English alphabet, which might be unavailable or difficult
191+
to use for people and systems using non-Latin scripts (e.g. Arabic or Japanese).
192+
193+
The :class:`Symfony\\Component\\Intl\\Countries` class provides access to these
194+
numeric country codes::
195+
196+
use Symfony\Component\Intl\Countries;
197+
198+
\Locale::setDefault('en');
199+
200+
$numericCodes = Countries::getNumericCodes();
201+
// ('alpha2Code' => 'numericCode')
202+
// => ['AA' => '958', 'AD' => '020', ...]
203+
204+
$numericCode = Countries::getNumericCode('FR');
205+
// => '250'
206+
207+
$alpha2 = Countries::getAlpha2FromNumeric('250');
208+
// => 'FR'
209+
210+
$exists = Countries::numericCodeExists('250');
211+
// => true
212+
213+
.. versionadded:: 6.4
214+
215+
The support for numeric country codes was introduced in Symfony 6.4.
216+
182217
Locales
183218
~~~~~~~
184219

@@ -435,6 +470,7 @@ Learn more
435470
.. _`Unicode ISO 15924 Registry`: https://www.unicode.org/iso15924/iso15924-codes.html
436471
.. _`ISO 3166-1 alpha-2`: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
437472
.. _`ISO 3166-1 alpha-3`: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
473+
.. _`ISO 3166-1 numeric`: https://en.wikipedia.org/wiki/ISO_3166-1_numeric
438474
.. _`UTC/GMT time offsets`: https://en.wikipedia.org/wiki/List_of_UTC_time_offsets
439475
.. _`daylight saving time (DST)`: https://en.wikipedia.org/wiki/Daylight_saving_time
440476
.. _`ISO 639-1 alpha-2`: https://en.wikipedia.org/wiki/ISO_639-1

components/lock.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -470,16 +470,16 @@ avoid stalled locks::
470470

471471
The ``MongoDbStore`` takes the following ``$options`` (depending on the first parameter type):
472472

473-
============= ================================================================================================
474-
Option Description
475-
============= ================================================================================================
476-
gcProbability Should a TTL Index be created expressed as a probability from 0.0 to 1.0 (Defaults to ``0.001``)
477-
gcProbablity Same as ``gcProbability``, see the deprecation note below
478-
database The name of the database
479-
collection The name of the collection
480-
uriOptions Array of URI options for `MongoDBClient::__construct`_
481-
driverOptions Array of driver options for `MongoDBClient::__construct`_
482-
============= ================================================================================================
473+
============== ================================================================================================
474+
Option Description
475+
============== ================================================================================================
476+
gcProbability Should a TTL Index be created expressed as a probability from 0.0 to 1.0 (Defaults to ``0.001``)
477+
gcProbablity Same as ``gcProbability``, see the deprecation note below
478+
database The name of the database
479+
collection The name of the collection
480+
uriOptions Array of URI options for `MongoDBClient::__construct`_
481+
driverOptions Array of driver options for `MongoDBClient::__construct`_
482+
============= ================================================================================================
483483

484484
.. deprecated:: 6.3
485485

0 commit comments

Comments
 (0)