Skip to content

Commit f956a36

Browse files
committed
Merge branch '5.1' into 5.2
* 5.1: (31 commits) Fix package name for OvhCloud notifier Fix wrong key name Enhancement: Streamline workflow GitHub Actions: use docker container for CI build Bus restricting with Interfaces Security: add example code which Maker Bundle generated [symfony#14550] Reduce nr of lines used for exception Section method only in ConsoleOutputInterface Added a new troubleshooting section in the maintainer guide Removed duplicated line Complete documentation about mailer integration [symfony#14083] Revert mailer.headers option in 4.4 - 5.1 Removed 4.3 versionadded directive [symfony#14565] Minor formatting fixes Updated getParent() description with the why/when (thanks javier!) [Form] Added explicit `getParent()` call in types inheritance mechanism Added PHP types to the DI related articles Added PHP types to the Form related articles Added PHP types to the Doctrine related articles Tweak ...
2 parents def4e1a + 8adb4f1 commit f956a36

Some content is hidden

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

60 files changed

+882
-513
lines changed

.github/workflows/ci.yaml

Lines changed: 43 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: CI
2+
13
on:
24
push:
35
branches-ignore:
@@ -6,83 +8,73 @@ on:
68
branches-ignore:
79
- 'github-comments'
810

9-
name: CI
10-
1111
jobs:
12-
build:
13-
name: Build
12+
sphinx-build:
13+
name: Build (Sphinx)
1414

1515
runs-on: ubuntu-latest
1616

17+
container: python:3.7-alpine
18+
1719
steps:
1820
- name: "Checkout"
1921
uses: actions/checkout@v2
2022

21-
- name: "Set up Python 3.7"
22-
uses: actions/setup-python@v1
23-
with:
24-
python-version: '3.7' # Semantic version range syntax or exact version of a Python version
25-
2623
- name: "Display Python version"
2724
run: python -c "import sys; print(sys.version)"
2825

29-
- name: "Install Sphinx dependencies"
30-
run: sudo apt-get install python-dev build-essential
26+
- name: "Install Sphinx"
27+
run: pip install --user sphinx
3128

32-
- name: "Cache pip"
33-
uses: actions/cache@v2
34-
with:
35-
path: ~/.cache/pip
36-
key: ${{ runner.os }}-pip-${{ hashFiles('_build/.requirements.txt') }}
37-
restore-keys: |
38-
${{ runner.os }}-pip-
29+
- name: "Install dependencies"
30+
run: apk add --no-cache git make
3931

40-
- name: "Install Sphinx + requirements via pip"
32+
- name: "Install custom requirements via pip"
4133
run: pip install -r _build/.requirements.txt
4234

4335
- name: "Build documentation"
4436
run: make -C _build SPHINXOPTS="-nqW -j auto" html
4537

46-
build-php:
47-
name: Symfony doc builder
38+
symfony-docs-builder-build:
39+
name: Build (symfony/docs-builder)
4840

4941
runs-on: ubuntu-latest
5042

5143
continue-on-error: true
5244

5345
steps:
54-
- name: "Checkout"
55-
uses: actions/checkout@v2
56-
57-
- name: "Set-up PHP"
58-
uses: shivammathur/setup-php@v2
59-
with:
60-
php-version: 7.2
61-
coverage: none
62-
tools: "composer:v2"
63-
64-
- name: Get composer cache directory
65-
id: composercache
66-
working-directory: _build
67-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
68-
69-
- name: Cache dependencies
70-
uses: actions/cache@v2
71-
with:
72-
path: ${{ steps.composercache.outputs.dir }}
73-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
74-
restore-keys: ${{ runner.os }}-composer-
75-
76-
- name: "Install dependencies"
77-
working-directory: _build
78-
run: composer install --prefer-dist --no-progress
79-
80-
- name: "Build the docs"
81-
working-directory: _build
82-
run: php build.php -vvv
46+
- name: "Checkout"
47+
uses: actions/checkout@v2
48+
49+
- name: "Set-up PHP"
50+
uses: shivammathur/setup-php@v2
51+
with:
52+
php-version: 7.2
53+
coverage: none
54+
tools: "composer:v2"
55+
56+
- name: Get composer cache directory
57+
id: composercache
58+
working-directory: _build
59+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
60+
61+
- name: Cache dependencies
62+
uses: actions/cache@v2
63+
with:
64+
path: ${{ steps.composercache.outputs.dir }}
65+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
66+
restore-keys: ${{ runner.os }}-composer-
67+
68+
- name: "Install dependencies"
69+
working-directory: _build
70+
run: composer install --prefer-dist --no-progress
71+
72+
- name: "Build the docs"
73+
working-directory: _build
74+
run: php build.php -vvv
8375

8476
doctor-rst:
85-
name: DOCtor-RST
77+
name: Lint (DOCtor-RST)
8678

8779
runs-on: ubuntu-latest
8880

README.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Symfony documentation, please read
1111
[Contributing to the Documentation](https://symfony.com/doc/current/contributing/documentation/overview.html)
1212

1313
> **Note**
14-
> All pull requests must be based off of the **3.4** branch,
15-
> unless you're documenting a feature that was introduced *after* Symfony 3.4
16-
> (e.g. in Symfony 4.4), **not** the master or older branches.
14+
> All pull requests must be based off of the **4.4** branch,
15+
> unless you're documenting a feature that was introduced *after* Symfony 4.4
16+
> (e.g. in Symfony 5.2), **not** the ``5.x`` or older branches.
1717
1818
SymfonyCloud
1919
------------

_build/maintainer_guide.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,23 @@ in the tree as follows:
335335
$ git push origin
336336
$ git push upstream
337337
338+
Merging in the wrong branch
339+
...........................
340+
341+
A Pull Request was made against ``5.x`` but it should be merged in ``5.1`` and you
342+
forgot to merge as ``gh merge NNNNN -s 5.1`` to change the merge branch. Solution:
343+
344+
.. code-block:: terminal
345+
346+
$ git checkout 5.1
347+
$ git cherry-pick <SHA OF YOUR MERGE COMMIT> -m 1
348+
$ git checkout 5.x
349+
$ git revert <SHA OF YOUR MERGE COMMIT> -m 1
350+
# now continue with the normal "upmerging"
351+
$ git checkout 5.2
352+
$ git merge 5.1
353+
$ ...
354+
338355
.. _`symfony/symfony-docs`: https://github.com/symfony/symfony-docs
339356
.. _`Symfony Docs team`: https://github.com/orgs/symfony/teams/team-symfony-docs
340357
.. _`Symfony's respectful review comments`: https://symfony.com/doc/current/contributing/community/review-comments.html

components/cache/adapters/filesystem_adapter.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@ and cache root path as constructor parameters::
5050

5151
.. note::
5252

53-
Since Symfony 3.4, this adapter implements
54-
:class:`Symfony\\Component\\Cache\\PruneableInterface`, enabling manual
55-
:ref:`pruning of expired cache items <component-cache-cache-pool-prune>` by
56-
calling its ``prune()`` method.
57-
53+
This adapter implements :class:`Symfony\\Component\\Cache\\PruneableInterface`,
54+
enabling manual :ref:`pruning of expired cache items <component-cache-cache-pool-prune>`
55+
by calling its ``prune()`` method.
5856

5957
.. _filesystem-tag-aware-adapter:
6058

components/cache/adapters/pdo_doctrine_dbal_adapter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ your code.
4444

4545
.. note::
4646

47-
Since Symfony 3.4, this adapter implements :class:`Symfony\\Component\\Cache\\PruneableInterface`,
47+
This adapter implements :class:`Symfony\\Component\\Cache\\PruneableInterface`,
4848
allowing for manual :ref:`pruning of expired cache entries <component-cache-cache-pool-prune>` by
4949
calling its ``prune()`` method.
5050

components/cache/adapters/php_files_adapter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ directory path as constructor arguments::
6363

6464
.. note::
6565

66-
Since Symfony 3.4, this adapter implements :class:`Symfony\\Component\\Cache\\PruneableInterface`,
66+
This adapter implements :class:`Symfony\\Component\\Cache\\PruneableInterface`,
6767
allowing for manual :ref:`pruning of expired cache entries <component-cache-cache-pool-prune>` by
6868
calling its ``prune()`` method.
6969

components/cache/cache_invalidation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ your fronts and have very fast invalidation checks::
8787

8888
.. note::
8989

90-
Since Symfony 3.4, :class:`Symfony\\Component\\Cache\\Adapter\\TagAwareAdapter`
90+
:class:`Symfony\\Component\\Cache\\Adapter\\TagAwareAdapter`
9191
implements :class:`Symfony\\Component\\Cache\\PruneableInterface`,
9292
enabling manual
9393
:ref:`pruning of expired cache entries <component-cache-cache-pool-prune>` by

console.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,24 @@ called "output sections". Create one or more of these sections when you need to
187187
clear and overwrite the output information.
188188

189189
Sections are created with the
190-
:method:`Symfony\\Component\\Console\\Output\\ConsoleOutput::section` method,
191-
which returns an instance of
190+
:method:`ConsoleOutput::section() <Symfony\\Component\\Console\\Output\\ConsoleOutput::section>`
191+
method, which returns an instance of
192192
:class:`Symfony\\Component\\Console\\Output\\ConsoleSectionOutput`::
193193

194+
// ...
195+
use Symfony\Component\Console\Output\ConsoleOutputInterface;
196+
194197
class MyCommand extends Command
195198
{
196199
protected function execute(InputInterface $input, OutputInterface $output)
197200
{
201+
if (!$output instanceof ConsoleOutputInterface) {
202+
throw new \LogicException('This command accepts only an instance of "ConsoleOutputInterface".');
203+
}
204+
198205
$section1 = $output->section();
199206
$section2 = $output->section();
207+
200208
$section1->writeln('Hello');
201209
$section2->writeln('World!');
202210
// Output displays "Hello\nWorld!\n"

contributing/code/bc.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ backward compatibility promise:
7272
+-----------------------------------------------+-----------------------------+
7373
| Type hint against the interface | Yes |
7474
+-----------------------------------------------+-----------------------------+
75-
| Call a method | Yes |
75+
| Call a method | Yes [10]_ |
7676
+-----------------------------------------------+-----------------------------+
7777
| **If you implement the interface and...** | **Then we guarantee BC...** |
7878
+-----------------------------------------------+-----------------------------+
@@ -114,13 +114,13 @@ covered by our backward compatibility promise:
114114
+-----------------------------------------------+-----------------------------+
115115
| Access a public property | Yes |
116116
+-----------------------------------------------+-----------------------------+
117-
| Call a public method | Yes |
117+
| Call a public method | Yes [10]_ |
118118
+-----------------------------------------------+-----------------------------+
119119
| **If you extend the class and...** | **Then we guarantee BC...** |
120120
+-----------------------------------------------+-----------------------------+
121121
| Access a protected property | Yes |
122122
+-----------------------------------------------+-----------------------------+
123-
| Call a protected method | Yes |
123+
| Call a protected method | Yes [10]_ |
124124
+-----------------------------------------------+-----------------------------+
125125
| Override a public property | Yes |
126126
+-----------------------------------------------+-----------------------------+
@@ -445,4 +445,8 @@ Turn static into non static No
445445
446446
.. [9] Allowed for the ``void`` return type.
447447
448+
.. [10] Parameter names are not part of the compatibility promise. Using
449+
PHP 8's named arguments feature might break your code when upgrading to
450+
newer Symfony versions.
451+
448452
.. _`Semantic Versioning`: https://semver.org/

contributing/code/pull_requests.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,24 +124,24 @@ Choose the right Branch
124124
Before working on a PR, you must determine on which branch you need to
125125
work:
126126

127-
* ``3.4``, if you are fixing a bug for an existing feature or want to make a
127+
* ``4.4``, if you are fixing a bug for an existing feature or want to make a
128128
change that falls into the :doc:`list of acceptable changes in patch versions
129129
</contributing/code/maintenance>` (you may have to choose a higher branch if
130130
the feature you are fixing was introduced in a later version);
131131

132132
* ``5.x``, if you are adding a new feature.
133133

134134
The only exception is when a new :doc:`major Symfony version </contributing/community/releases>`
135-
(4.0, 5.0, etc.) comes out every two years. Because of the
135+
(5.0, 6.0, etc.) comes out every two years. Because of the
136136
:ref:`special development process <major-version-development>` of those versions,
137-
you need to use the previous minor version for the features (e.g. use ``3.4``
138-
instead of ``4.0``, use ``4.4`` instead of ``5.0``, etc.)
137+
you need to use the previous minor version for the features (e.g. use ``4.4``
138+
instead of ``5.0``, use ``5.4`` instead of ``6.0``, etc.)
139139

140140
.. note::
141141

142142
All bug fixes merged into maintenance branches are also merged into more
143143
recent branches on a regular basis. For instance, if you submit a PR
144-
for the ``3.4`` branch, the PR will also be applied by the core team on
144+
for the ``4.4`` branch, the PR will also be applied by the core team on
145145
the ``5.x`` branch.
146146

147147
Create a Topic Branch
@@ -154,18 +154,18 @@ topic branch:
154154
155155
$ git checkout -b BRANCH_NAME 5.x
156156
157-
Or, if you want to provide a bug fix for the ``3.4`` branch, first track the remote
158-
``3.4`` branch locally:
157+
Or, if you want to provide a bug fix for the ``4.4`` branch, first track the remote
158+
``4.4`` branch locally:
159159

160160
.. code-block:: terminal
161161
162-
$ git checkout --track origin/3.4
162+
$ git checkout --track origin/4.4
163163
164-
Then create a new branch off the ``3.4`` branch to work on the bug fix:
164+
Then create a new branch off the ``4.4`` branch to work on the bug fix:
165165

166166
.. code-block:: terminal
167167
168-
$ git checkout -b BRANCH_NAME 3.4
168+
$ git checkout -b BRANCH_NAME 4.4
169169
170170
.. tip::
171171

@@ -285,7 +285,7 @@ while to finish your changes):
285285
286286
.. tip::
287287

288-
Replace ``5.x`` with the branch you selected previously (e.g. ``3.4``)
288+
Replace ``5.x`` with the branch you selected previously (e.g. ``4.4``)
289289
if you are working on a bug fix.
290290

291291
When doing the ``rebase`` command, you might have to fix merge conflicts.
@@ -312,8 +312,8 @@ You can now make a pull request on the ``symfony/symfony`` GitHub repository.
312312

313313
.. tip::
314314

315-
Take care to point your pull request towards ``symfony:3.4`` if you want
316-
the core team to pull a bug fix based on the ``3.4`` branch.
315+
Take care to point your pull request towards ``symfony:4.4`` if you want
316+
the core team to pull a bug fix based on the ``4.4`` branch.
317317

318318
To ease the core team work, always include the modified components in your
319319
pull request message, like in:
@@ -403,7 +403,7 @@ Rework your Pull Request
403403

404404
Based on the feedback on the pull request, you might need to rework your
405405
PR. Before re-submitting the PR, rebase with ``upstream/5.x`` or
406-
``upstream/3.4``, don't merge; and force the push to the origin:
406+
``upstream/4.4``, don't merge; and force the push to the origin:
407407

408408
.. code-block:: terminal
409409

contributing/community/releases.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ release and maintain its different versions.
77
Symfony releases follow the `semantic versioning`_ strategy and they are
88
published through a *time-based model*:
99

10-
* A new **Symfony patch version** (e.g. 4.4.9, 5.0.9, 5.1.1) comes out roughly every
10+
* A new **Symfony patch version** (e.g. 4.4.12, 5.1.9) comes out roughly every
1111
month. It only contains bug fixes, so you can safely upgrade your applications;
1212
* A new **Symfony minor version** (e.g. 4.4, 5.1) comes out every *six months*:
1313
one in *May* and one in *November*. It contains bug fixes and new features, but
@@ -53,7 +53,7 @@ Maintenance
5353

5454
Starting from the Symfony 3.x branch, the number of minor versions is limited to
5555
five per branch (X.0, X.1, X.2, X.3 and X.4). The last minor version of a branch
56-
(e.g. 3.4, 4.4, 5.4) is considered a **long-term support version** and the other
56+
(e.g. 4.4, 5.4) is considered a **long-term support version** and the other
5757
ones are considered **standard versions**:
5858

5959
======================= ===================== ================================
@@ -87,17 +87,17 @@ learn more about how deprecations are handled in Symfony.
8787
.. _major-version-development:
8888

8989
This deprecation policy also requires a custom development process for major
90-
versions (4.0, 5.0, 6.0, etc.) In those cases, Symfony develops at the same time
91-
two versions: the new major one (e.g. 4.0) and the latest version of the
92-
previous branch (e.g. 3.4).
90+
versions (5.0, 6.0, etc.) In those cases, Symfony develops at the same time
91+
two versions: the new major one (e.g. 5.0) and the latest version of the
92+
previous branch (e.g. 4.4).
9393

9494
Both versions have the same new features, but they differ in the deprecated
95-
features. The oldest version (3.4 in this example) contains all the deprecated
96-
features whereas the new version (4.0 in this example) removes all of them.
95+
features. The oldest version (4.4 in this example) contains all the deprecated
96+
features whereas the new version (5.0 in this example) removes all of them.
9797

98-
This allows you to upgrade your projects to the latest minor version (e.g. 3.4),
98+
This allows you to upgrade your projects to the latest minor version (e.g. 4.4),
9999
see all the deprecation messages and fix them. Once you have fixed all those
100-
deprecations, you can upgrade to the new major version (e.g. 4.0) without
100+
deprecations, you can upgrade to the new major version (e.g. 5.0) without
101101
effort, because it contains the same features (the only difference are the
102102
deprecated features, which your project no longer uses).
103103

0 commit comments

Comments
 (0)