|
1 |
| -Upgrading a Major Version (e.g. 5.4.0 to 6.0.0) |
| 1 | +Upgrading a Major Version (e.g. 6.4.0 to 7.0.0) |
2 | 2 | ===============================================
|
3 | 3 |
|
4 | 4 | Every two years, Symfony releases a new major version release (the first number
|
@@ -27,10 +27,10 @@ backwards incompatible changes. To accomplish this, the "old" (e.g. functions,
|
27 | 27 | classes, etc) code still works, but is marked as *deprecated*, indicating that
|
28 | 28 | it will be removed/changed in the future and that you should stop using it.
|
29 | 29 |
|
30 |
| -When the major version is released (e.g. 6.0.0), all deprecated features and |
| 30 | +When the major version is released (e.g. 7.0.0), all deprecated features and |
31 | 31 | functionality are removed. So, as long as you've updated your code to stop
|
32 | 32 | using these deprecated features in the last version before the major (e.g.
|
33 |
| -``5.4.*``), you should be able to upgrade without a problem. That means that |
| 33 | +``6.4.*``), you should be able to upgrade without a problem. That means that |
34 | 34 | you should first :doc:`upgrade to the last minor version </setup/upgrade_minor>`
|
35 | 35 | (e.g. 5.4) so that you can see *all* the deprecations.
|
36 | 36 |
|
@@ -107,7 +107,7 @@ done!
|
107 | 107 | .. sidebar:: Using the Weak Deprecations Mode
|
108 | 108 |
|
109 | 109 | Sometimes, you can't fix all deprecations (e.g. something was deprecated
|
110 |
| - in 5.4 and you still need to support 5.3). In these cases, you can still |
| 110 | + in 6.4 and you still need to support 6.3). In these cases, you can still |
111 | 111 | use the bridge to fix as many deprecations as possible and then allow
|
112 | 112 | more of them to make your tests pass again. You can do this by using the
|
113 | 113 | ``SYMFONY_DEPRECATIONS_HELPER`` env variable:
|
@@ -144,35 +144,33 @@ starting with ``symfony/`` to the new major version:
|
144 | 144 | "...": "...",
|
145 | 145 |
|
146 | 146 | "require": {
|
147 |
| - - "symfony/cache": "5.4.*", |
148 |
| - + "symfony/cache": "6.0.*", |
149 |
| - - "symfony/config": "5.4.*", |
150 |
| - + "symfony/config": "6.0.*", |
151 |
| - - "symfony/console": "5.4.*", |
152 |
| - + "symfony/console": "6.0.*", |
| 147 | + - "symfony/config": "6.4.*", |
| 148 | + + "symfony/config": "7.0.*", |
| 149 | + - "symfony/console": "6.4.*", |
| 150 | + + "symfony/console": "7.0.*", |
153 | 151 | "...": "...",
|
154 | 152 |
|
155 | 153 | "...": "A few libraries starting with symfony/ follow their own
|
156 | 154 | versioning scheme (e.g. symfony/polyfill-[...],
|
157 | 155 | symfony/ux-[...], symfony/[...]-bundle).
|
158 | 156 | You do not need to update these versions: you can
|
159 | 157 | upgrade them independently whenever you want",
|
160 |
| - "symfony/monolog-bundle": "^3.5", |
| 158 | + "symfony/monolog-bundle": "^3.10", |
161 | 159 | },
|
162 | 160 | "...": "...",
|
163 | 161 | }
|
164 | 162 |
|
165 | 163 | At the bottom of your ``composer.json`` file, in the ``extra`` block you can
|
166 | 164 | find a data setting for the Symfony version. Make sure to also upgrade
|
167 |
| -this one. For instance, update it to ``6.0.*`` to upgrade to Symfony 6.0: |
| 165 | +this one. For instance, update it to ``7.0.*`` to upgrade to Symfony 7.0: |
168 | 166 |
|
169 | 167 | .. code-block:: diff
|
170 | 168 |
|
171 | 169 | "extra": {
|
172 | 170 | "symfony": {
|
173 | 171 | "allow-contrib": false,
|
174 |
| - - "require": "5.4.*" |
175 |
| - + "require": "6.0.*" |
| 172 | + - "require": "6.4.*" |
| 173 | + + "require": "7.0.*" |
176 | 174 | }
|
177 | 175 | }
|
178 | 176 |
|
@@ -215,13 +213,13 @@ included in the Symfony repository for any BC break that you need to be aware of
|
215 | 213 | Upgrading to Symfony 6: Add Native Return Types
|
216 | 214 | -----------------------------------------------
|
217 | 215 |
|
218 |
| -Symfony 6 will come with native PHP return types to (almost all) methods. |
| 216 | +Symfony 6 and Symfony 6 have come with native PHP return types to (almost all) methods. |
219 | 217 |
|
220 | 218 | In PHP, if the parent has a return type declaration, any class implementing
|
221 | 219 | or overriding the method must have the return type as well. However, you
|
222 | 220 | can add a return type before the parent adds one. This means that it is
|
223 | 221 | important to add the native PHP return types to your classes before
|
224 |
| -upgrading to Symfony 6.0. Otherwise, you will get incompatible declaration |
| 222 | +upgrading to Symfony 6.0 or 7.0. Otherwise, you will get incompatible declaration |
225 | 223 | errors.
|
226 | 224 |
|
227 | 225 | When debug mode is enabled (typically in the dev and test environment),
|
|
0 commit comments