Skip to content

Commit 3a753d3

Browse files
committed
Merge remote-tracking branch 'upstream/7.0' into 7.0
* upstream/7.0: Fix table length - - Rename Service name Remove obsolete versionadded directive [Form] Document using TranslatableMessage in form Fields [#19122] Reword - - [Workflow] feature symfony#50604 metadata dumping [Bundle] add tip for marking internal services as hidden [DependencyInjection] Mention `exclude_self` minor Update serverVersion for MariaDB Update console.rst Fix custom form type docs. [Security] Migrate to ConfigBuilder format for 6.3+ [SecurityBundle] Improve support for authenticators that don't need a user provider
2 parents b04a833 + 103241d commit 3a753d3

File tree

13 files changed

+179
-49
lines changed

13 files changed

+179
-49
lines changed
Loading

bundles/best_practices.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,13 @@ can be used for autowiring.
476476
Services should not use autowiring or autoconfiguration. Instead, all services should
477477
be defined explicitly.
478478

479+
.. tip::
480+
481+
If there is no intention for the service id to be used by the end user, you can
482+
mark it as *hidden* by prefixing it with a dot (e.g. ``.acme_blog.logger``).
483+
This prevents the service from being listed in the default ``debug:container``
484+
command output.
485+
479486
.. seealso::
480487

481488
You can learn much more about service loading in bundles reading this article:

console.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,8 @@ console::
489489
{
490490
public function testExecute(): void
491491
{
492-
$kernel = self::bootKernel();
493-
$application = new Application($kernel);
492+
self::bootKernel();
493+
$application = new Application(self::$kernel);
494494

495495
$command = $application->find('app:create-user');
496496
$commandTester = new CommandTester($command);

doctrine.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ The database connection information is stored as an environment variable called
4444
DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
4545
4646
# to use mariadb:
47-
DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=mariadb-10.5.8"
47+
# Before doctrine/dbal < 3.7
48+
# DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=mariadb-10.5.8"
49+
# Since doctrine/dbal 3.7
50+
# DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=10.5.8-MariaDB"
4851
4952
# to use sqlite:
5053
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/app.db"

form/create_custom_field_type.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,8 @@ fragments used to render the types:
363363
364364
{# ... here you will add the Twig code ... #}
365365
366-
Then, update the :ref:`form_themes option <reference-twig-tag-form-theme>` to
367-
add this new template at the beginning of the list (the first one overrides the
368-
rest of files):
366+
Then, update the :ref:`form_themes option <config-twig-form-themes>` to
367+
add this new template at the end of the list (each theme overrides all the previous ones):
369368

370369
.. configuration-block::
371370

@@ -374,8 +373,8 @@ rest of files):
374373
# config/packages/twig.yaml
375374
twig:
376375
form_themes:
377-
- 'form/custom_types.html.twig'
378376
- '...'
377+
- 'form/custom_types.html.twig'
379378
380379
.. code-block:: xml
381380
@@ -390,8 +389,8 @@ rest of files):
390389
https://symfony.com/schema/dic/twig/twig-1.0.xsd">
391390
392391
<twig:config>
393-
<twig:form-theme>form/custom_types.html.twig</twig:form-theme>
394392
<twig:form-theme>...</twig:form-theme>
393+
<twig:form-theme>form/custom_types.html.twig</twig:form-theme>
395394
</twig:config>
396395
</container>
397396
@@ -402,8 +401,8 @@ rest of files):
402401
403402
return static function (TwigConfig $twig): void {
404403
$twig->formThemes([
405-
'form/custom_types.html.twig',
406404
'...',
405+
'form/custom_types.html.twig',
407406
]);
408407
};
409408

mailer.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,17 @@ Using a 3rd Party Transport
9999
Instead of using your own SMTP server or sendmail binary, you can send emails
100100
via a third-party provider:
101101

102-
===================== ==============================================
102+
===================== ===============================================
103103
Service Install with
104-
===================== ==============================================
104+
===================== ===============================================
105105
`Amazon SES`_ ``composer require symfony/amazon-mailer``
106106
`Brevo`_ ``composer require symfony/brevo-mailer``
107107
`Infobip`_ ``composer require symfony/infobip-mailer``
108-
`Mailchimp Mandrill`_ ``composer require symfony/mailchimp-mailer``
109108
`Mailgun`_ ``composer require symfony/mailgun-mailer``
110109
`Mailjet`_ ``composer require symfony/mailjet-mailer``
111110
`MailPace`_ ``composer require symfony/mail-pace-mailer``
112111
`MailerSend`_ ``composer require symfony/mailer-send-mailer``
112+
`Mandrill`_ ``composer require symfony/mailchimp-mailer``
113113
`Postmark`_ ``composer require symfony/postmark-mailer``
114114
`Scaleway`_ ``composer require symfony/scaleway-mailer``
115115
`SendGrid`_ ``composer require symfony/sendgrid-mailer``
@@ -1826,8 +1826,8 @@ the :class:`Symfony\\Bundle\\FrameworkBundle\\Test\\MailerAssertionsTrait`::
18261826
.. _`Inky`: https://get.foundation/emails/docs/inky.html
18271827
.. _`league/html-to-markdown`: https://github.com/thephpleague/html-to-markdown
18281828
.. _`load balancing`: https://en.wikipedia.org/wiki/Load_balancing_(computing)
1829-
.. _`Mailchimp Mandrill`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Mailchimp/README.md
18301829
.. _`MailerSend`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/MailerSend/README.md
1830+
.. _`Mandrill`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Mailchimp/README.md
18311831
.. _`Mailgun`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Mailgun/README.md
18321832
.. _`Mailjet`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Mailjet/README.md
18331833
.. _`Markdown syntax`: https://commonmark.org/

rate_limiter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ the :class:`Symfony\\Component\\RateLimiter\\Reservation` object returned by the
348348
$limit = $limiter->consume();
349349
$headers = [
350350
'X-RateLimit-Remaining' => $limit->getRemainingTokens(),
351-
'X-RateLimit-Retry-After' => $limit->calculateTimeForTokens(1, 1),
351+
'X-RateLimit-Retry-After' => $limit->getRetryAfter()->getTimestamp() - time(),
352352
'X-RateLimit-Limit' => $limit->getLimit(),
353353
];
354354

reference/configuration/security.rst

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -479,25 +479,21 @@ user logs out::
479479
.. code-block:: php
480480
481481
// config/packages/security.php
482-
$container->loadFromExtension('security', [
482+
483+
// ...
484+
485+
return static function (SecurityConfig $securityConfig): void {
483486
// ...
484-
'firewalls' => [
485-
'main' => [
486-
'logout' => [
487-
'delete_cookies' => [
488-
'cookie1-name' => null,
489-
'cookie2-name' => [
490-
'path' => '/',
491-
],
492-
'cookie3-name' => [
493-
'path' => null,
494-
'domain' => 'example.com',
495-
],
496-
],
497-
],
498-
],
499-
],
500-
]);
487+
488+
$securityConfig->firewall('main')
489+
->logout()
490+
->deleteCookie('cookie1-name')
491+
->deleteCookie('cookie2-name')
492+
->path('/')
493+
->deleteCookie('cookie3-name')
494+
->path(null)
495+
->domain('example.com');
496+
};
501497
502498
503499
clear_site_data
@@ -554,19 +550,16 @@ It's also possible to use ``*`` as a wildcard for all directives:
554550
.. code-block:: php
555551
556552
// config/packages/security.php
557-
$container->loadFromExtension('security', [
553+
554+
// ...
555+
556+
return static function (SecurityConfig $securityConfig): void {
558557
// ...
559-
'firewalls' => [
560-
'main' => [
561-
'logout' => [
562-
'clear-site-data' => [
563-
'cookies',
564-
'storage',
565-
],
566-
],
567-
],
568-
],
569-
]);
558+
559+
$securityConfig->firewall('main')
560+
->logout()
561+
->clearSiteData(['cookies', 'storage']);
562+
};
570563
571564
invalidate_session
572565
..................
@@ -1020,6 +1013,8 @@ multiple firewalls, the "context" could actually be shared:
10201013
ignored and you won't be able to authenticate on multiple firewalls at the
10211014
same time.
10221015

1016+
.. _reference-security-stateless:
1017+
10231018
stateless
10241019
~~~~~~~~~
10251020

reference/forms/types/options/button_label.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
``label``
22
~~~~~~~~~
33

4-
**type**: ``string`` **default**: The label is "guessed" from the field name
4+
**type**: ``string`` or ``TranslatableMessage`` **default**: The label is "guessed" from the field name
55

66
Sets the label that will be displayed on the button. The label can also
77
be directly set inside the template:

reference/forms/types/options/placeholder.rst.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
``placeholder``
22
~~~~~~~~~~~~~~~
33

4-
**type**: ``string`` or ``boolean``
4+
**type**: ``string`` or ``TranslatableMessage`` or ``boolean``
55

66
This option determines whether or not a special "empty" option (e.g. "Choose
77
an option") will appear at the top of a select widget. This option only
@@ -14,6 +14,9 @@ applies if the ``multiple`` option is set to false.
1414

1515
$builder->add('states', ChoiceType::class, [
1616
'placeholder' => 'Choose an option',
17+
18+
// or if you want to translate the text
19+
'placeholder' => new TranslatableMessage('form.placeholder.select_option', [], 'form'),
1720
]);
1821

1922
* Guarantee that no "empty" value option is displayed::

0 commit comments

Comments
 (0)