Skip to content

Commit bdf8b00

Browse files
committed
Merge branch '5.4' into 6.2
* 5.4: Minor tweaks Update symfony_server.rst [Mailer] Link to bridges READMEs [Security] Document required badges Fix minor syntax errors Attributes that relate to controller arguments should start with `Map` Migrate the CI away from deprecated features
2 parents a63654c + 8c900ca commit bdf8b00

File tree

10 files changed

+118
-48
lines changed

10 files changed

+118
-48
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Get composer cache directory
3434
id: composercache
3535
working-directory: _build
36-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
36+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
3737

3838
- name: Cache dependencies
3939
uses: actions/cache@v3
@@ -63,7 +63,7 @@ jobs:
6363
run: mkdir .cache
6464

6565
- name: "Extract base branch name"
66-
run: echo "##[set-output name=branch;]$(echo ${GITHUB_BASE_REF:=${GITHUB_REF##*/}})"
66+
run: echo "branch=$(echo ${GITHUB_BASE_REF:=${GITHUB_REF##*/}})" >> $GITHUB_OUTPUT
6767
id: extract_base_branch
6868

6969
- name: "Cache DOCtor-RST"
@@ -100,12 +100,12 @@ jobs:
100100
- name: Find modified files
101101
id: find-files
102102
working-directory: docs
103-
run: echo "::set-output name=files::$(git diff --name-only origin/${{ github.base_ref }} HEAD | grep ".rst" | tr '\n' ' ')"
103+
run: echo "files=$(git diff --name-only origin/${{ github.base_ref }} HEAD | grep ".rst" | tr '\n' ' ')" >> $GITHUB_OUTPUT
104104

105105
- name: Get composer cache directory
106106
id: composercache
107107
working-directory: docs/_build
108-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
108+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
109109

110110
- name: Cache dependencies
111111
if: ${{ steps.find-files.outputs.files }}

components/filesystem.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,12 @@ Finding Directories/Root Directories
469469
PHP offers the function :phpfunction:`dirname` to obtain the directory path of a
470470
file path. This method has a few quirks::
471471

472-
- `dirname()` does not accept backslashes on UNIX
473-
- `dirname("C:/Programs")` returns "C:", not "C:/"
474-
- `dirname("C:/")` returns ".", not "C:/"
475-
- `dirname("C:")` returns ".", not "C:/"
476-
- `dirname("Programs")` returns ".", not ""
477-
- `dirname()` does not canonicalize the result
472+
- ``dirname()`` does not accept backslashes on UNIX
473+
- ``dirname("C:/Programs")`` returns "C:", not "C:/"
474+
- ``dirname("C:/")`` returns ".", not "C:/"
475+
- ``dirname("C:")`` returns ".", not "C:/"
476+
- ``dirname("Programs")`` returns ".", not ""
477+
- ``dirname()`` does not canonicalize the result
478478

479479
:method:`Symfony\\Component\\Filesystem\\Path::getDirectory` fixes these
480480
shortcomings::

components/runtime.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ application outside of the global state in 6 steps:
370370
returns a :class:`Symfony\\Component\\Runtime\\RunnerInterface`: an instance
371371
that knows how to "run" the application object.
372372
#. The ``RunnerInterface::run(object $application)`` is called and it returns the
373-
exit status code as `int`.
373+
exit status code as ``int``.
374374
#. The PHP engine is terminated with this status code.
375375

376376
When creating a new runtime, there are two things to consider: First, what arguments

components/workflow.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ a ``Definition`` and a way to write the states to the objects (i.e. an
2828
instance of a :class:`Symfony\\Component\\Workflow\\MarkingStore\\MarkingStoreInterface`).
2929

3030
Consider the following example for a blog post. A post can have one of a number
31-
of predefined statuses (`draft`, `reviewed`, `rejected`, `published`). In a workflow,
31+
of predefined statuses (``draft``, ``reviewed``, ``rejected``, ``published``). In a workflow,
3232
these statuses are called **places**. You can define the workflow like this::
3333

3434
use Symfony\Component\Workflow\DefinitionBuilder;

contributing/code/standards.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,11 @@ Naming Conventions
230230

231231
* Suffix exceptions with ``Exception``;
232232

233-
* Prefix PHP attributes with ``As`` where applicable (e.g. ``#[AsCommand]``
234-
instead of ``#[Command]``, but ``#[When]`` is kept as-is);
233+
* Prefix PHP attributes that relate to service configuration with ``As``
234+
(e.g. ``#[AsCommand]``, ``#[AsEventListener]``, etc.);
235+
236+
* Prefix PHP attributes that relate to controller arguments with ``Map``
237+
(e.g. ``#[MapEntity]``, ``#[MapCurrentUser]``, etc.);
235238

236239
* Use UpperCamelCase for naming PHP files (e.g. ``EnvVarProcessor.php``) and
237240
snake case for naming Twig templates and web assets (``section_layout.html.twig``,

mailer.rst

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,19 @@ 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-
================== ==============================================
103-
Service Install with
104-
================== ==============================================
105-
Amazon SES ``composer require symfony/amazon-mailer``
106-
Infobip ``composer require symfony/infobip-mailer``
107-
MailChimp ``composer require symfony/mailchimp-mailer``
108-
Mailgun ``composer require symfony/mailgun-mailer``
109-
Mailjet ``composer require symfony/mailjet-mailer``
110-
MailPace ``composer require symfony/mail-pace-mailer``
111-
Postmark ``composer require symfony/postmark-mailer``
112-
SendGrid ``composer require symfony/sendgrid-mailer``
113-
Sendinblue ``composer require symfony/sendinblue-mailer``
114-
================== ==============================================
102+
===================== ==============================================
103+
Service Install with
104+
===================== ==============================================
105+
`Amazon SES`_ ``composer require symfony/amazon-mailer``
106+
`Infobip`_ ``composer require symfony/infobip-mailer``
107+
`MailChimp`_ ``composer require symfony/mailchimp-mailer``
108+
`Mailgun`_ ``composer require symfony/mailgun-mailer``
109+
`Mailjet`_ ``composer require symfony/mailjet-mailer``
110+
`MailPace`_ ``composer require symfony/mail-pace-mailer``
111+
`Postmark`_ ``composer require symfony/postmark-mailer``
112+
`SendGrid`_ ``composer require symfony/sendgrid-mailer``
113+
`Sendinblue`_ ``composer require symfony/sendinblue-mailer``
114+
===================== ==============================================
115115

116116
.. versionadded:: 6.2
117117

@@ -167,16 +167,16 @@ party provider:
167167
==================== ==================================================== =========================================== ========================================
168168
Provider SMTP HTTP API
169169
==================== ==================================================== =========================================== ========================================
170-
Amazon SES ses+smtp://USERNAME:PASSWORD@default ses+https://ACCESS_KEY:SECRET_KEY@default ses+api://ACCESS_KEY:SECRET_KEY@default
171-
Google Gmail gmail+smtp://USERNAME:APP-PASSWORD@default n/a n/a
172-
Mailchimp Mandrill mandrill+smtp://USERNAME:PASSWORD@default mandrill+https://KEY@default mandrill+api://KEY@default
173-
Mailgun mailgun+smtp://USERNAME:PASSWORD@default mailgun+https://KEY:DOMAIN@default mailgun+api://KEY:DOMAIN@default
174-
Mailjet mailjet+smtp://ACCESS_KEY:SECRET_KEY@default n/a mailjet+api://ACCESS_KEY:SECRET_KEY@default
175-
MailPace mailpace+api://API_TOKEN@default n/a mailpace+api://API_TOKEN@default
176-
Postmark postmark+smtp://ID@default n/a postmark+api://KEY@default
177-
Sendgrid sendgrid+smtp://KEY@default n/a sendgrid+api://KEY@default
178-
Sendinblue sendinblue+smtp://USERNAME:PASSWORD@default n/a sendinblue+api://KEY@default
179-
Infobip infobip+smtp://KEY@default n/a infobip+api://KEY@BASE_URL
170+
`Amazon SES`_ ses+smtp://USERNAME:PASSWORD@default ses+https://ACCESS_KEY:SECRET_KEY@default ses+api://ACCESS_KEY:SECRET_KEY@default
171+
`Google Gmail`_ gmail+smtp://USERNAME:APP-PASSWORD@default n/a n/a
172+
`Infobip`_ infobip+smtp://KEY@default n/a infobip+api://KEY@BASE_URL
173+
`Mailchimp Mandrill`_ mandrill+smtp://USERNAME:PASSWORD@default mandrill+https://KEY@default mandrill+api://KEY@default
174+
`Mailgun`_ mailgun+smtp://USERNAME:PASSWORD@default mailgun+https://KEY:DOMAIN@default mailgun+api://KEY:DOMAIN@default
175+
`Mailjet`_ mailjet+smtp://ACCESS_KEY:SECRET_KEY@default n/a mailjet+api://ACCESS_KEY:SECRET_KEY@default
176+
`MailPace`_ mailpace+api://API_TOKEN@default n/a mailpace+api://API_TOKEN@default
177+
`Postmark`_ postmark+smtp://ID@default n/a postmark+api://KEY@default
178+
`Sendgrid`_ sendgrid+smtp://KEY@default n/a sendgrid+api://KEY@default
179+
`Sendinblue`_ sendinblue+smtp://USERNAME:PASSWORD@default n/a sendinblue+api://KEY@default
180180
==================== ==================================================== =========================================== ========================================
181181

182182
.. caution::
@@ -1759,16 +1759,26 @@ the :class:`Symfony\\Bundle\\FrameworkBundle\\Test\\MailerAssertionsTrait`::
17591759
}
17601760
}
17611761

1762-
.. _`high availability`: https://en.wikipedia.org/wiki/High_availability
1763-
.. _`load balancing`: https://en.wikipedia.org/wiki/Load_balancing_(computing)
1762+
.. _`Amazon SES`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Amazon/README.md
1763+
.. _`App Password`: https://support.google.com/accounts/answer/185833
1764+
.. _`default_socket_timeout`: https://www.php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout
1765+
.. _`DKIM`: https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail
17641766
.. _`download the foundation-emails.css file`: https://github.com/foundation/foundation-emails/blob/develop/dist/foundation-emails.css
1767+
.. _`Google Gmail`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Google/README.md
1768+
.. _`high availability`: https://en.wikipedia.org/wiki/High_availability
1769+
.. _`Infobip`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Infobip/README.md
1770+
.. _`Inky`: https://get.foundation/emails/docs/inky.html
17651771
.. _`league/html-to-markdown`: https://github.com/thephpleague/html-to-markdown
1772+
.. _`load balancing`: https://en.wikipedia.org/wiki/Load_balancing_(computing)
1773+
.. _`MailChimp Mandrill`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Mailchimp/README.md
1774+
.. _`Mailgun`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Mailgun/README.md
1775+
.. _`Mailjet`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Mailjet/README.md
17661776
.. _`Markdown syntax`: https://commonmark.org/
1767-
.. _`Inky`: https://get.foundation/emails/docs/inky.html
1768-
.. _`S/MIME`: https://en.wikipedia.org/wiki/S/MIME
1769-
.. _`DKIM`: https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail
1777+
.. _`MailPace`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/MailPace/README.md
17701778
.. _`OpenSSL PHP extension`: https://www.php.net/manual/en/book.openssl.php
17711779
.. _`PEM encoded`: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail
1772-
.. _`default_socket_timeout`: https://www.php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout
1780+
.. _`Postmark`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Postmark/README.md
17731781
.. _`RFC 3986`: https://www.ietf.org/rfc/rfc3986.txt
1774-
.. _`App Password`: https://support.google.com/accounts/answer/185833
1782+
.. _`S/MIME`: https://en.wikipedia.org/wiki/S/MIME
1783+
.. _`SendGrid`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Sendgrid/README.md
1784+
.. _`Sendinblue`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Sendinblue/README.md

mercure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ Testing
615615

616616
During unit testing it's usually not needed to send updates to Mercure.
617617

618-
You can instead make use of the `MockHub` class::
618+
You can instead make use of the ``MockHub`` class::
619619

620620
// tests/FunctionalTest.php
621621
namespace App\Tests\Unit\Controller;

reference/configuration/security.rst

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,60 @@ a ``user_checker`` option to define the service used to perform those checks.
923923

924924
Learn more about user checkers in :doc:`/security/user_checkers`.
925925

926+
Required Badges
927+
~~~~~~~~~~~~~~~
928+
929+
Firewalls can configure a list of required badges that must be present on the authenticated passport:
930+
931+
.. configuration-block::
932+
933+
.. code-block:: yaml
934+
935+
# config/packages/security.yaml
936+
security:
937+
# ...
938+
939+
firewalls:
940+
main:
941+
# ...
942+
required_badges: ['CsrfTokenBadge', 'My\Badge']
943+
944+
.. code-block:: xml
945+
946+
<!-- config/packages/security.xml -->
947+
<?xml version="1.0" encoding="UTF-8" ?>
948+
<srv:container xmlns="http://symfony.com/schema/dic/security"
949+
xmlns:srv="http://symfony.com/schema/dic/services"
950+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
951+
xsi:schemaLocation="http://symfony.com/schema/dic/services
952+
https://symfony.com/schema/dic/services/services-1.0.xsd
953+
http://symfony.com/schema/dic/security
954+
https://symfony.com/schema/dic/security/security-1.0.xsd">
955+
956+
<config>
957+
<firewall name="main">
958+
<!-- ... -->
959+
<required_badge>CsrfTokenBadge</required_badge>
960+
<required_badge>My\Badge</required_badge>
961+
</firewall>
962+
</config>
963+
</srv:container>
964+
965+
.. code-block:: php
966+
967+
// config/packages/security.php
968+
use Symfony\Config\SecurityConfig;
969+
970+
return static function (SecurityConfig $security) {
971+
$mainFirewall = $security->firewall('main');
972+
$mainFirewall->requiredBadges(['CsrfTokenBadge', 'My\Badge']);
973+
// ...
974+
};
975+
976+
.. versionadded:: 5.3
977+
978+
The ``required_badges`` option was introduced in Symfony 5.3.
979+
926980
providers
927981
---------
928982

setup.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ the server by pressing ``Ctrl+C`` from your terminal.
144144
Symfony Docker Integration
145145
~~~~~~~~~~~~~~~~~~~~~~~~~~
146146

147-
If you'd like to use Docker with Symfony, see :doc:`setup/docker`
147+
If you'd like to use Docker with Symfony, see :doc:`/setup/docker`.
148148

149149
.. _symfony-flex:
150150

setup/symfony_server.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ run the Symfony server in the background:
6565

6666
.. code-block:: terminal
6767
68-
# change the path to the location of your Symfony binary
69-
$ sudo codesign --force --deep --sign - /opt/homebrew/Cellar/symfony-cli/5.4.21/bin/symfony
68+
# find the installed version of the Symfony binary
69+
$ symfony version
70+
71+
# change the path to the location of your Symfony binary and replace {version} too
72+
$ sudo codesign --force --deep --sign - /opt/homebrew/Cellar/symfony-cli/{version}/bin/symfony
7073
7174
Enabling PHP-FPM
7275
----------------

0 commit comments

Comments
 (0)