Commit 6b03342
committed
feature #1217 Upgrade to Symfony 5.3 (javiereguiluz, nicolas-grekas)
This PR was merged into the main branch.
Discussion
----------
Upgrade to Symfony 5.3
For now, it's Symfony 5.3 RC1, but we'll keep updating this branch until 5.3 stable.
-----
Things that I found while upgrading:
### Missing UPGRADE guide entry?
In the UPGRADE guide (https://github.com/symfony/symfony/blob/5.3/UPGRADE-5.3.md) we don't even mention `enable_csrf`, but this change is needed in `config/packages/security.yaml`:
Replace this:
```yaml
form_login:
csrf_token_generator: security.csrf.token_manager
```
by this:
```yaml
form_login:
enable_csrf: true
```
-----
### Unexpected failures
The upgrade guide mentions this:
```
PropertyInfo:
Deprecated the Type::getCollectionKeyType() and Type::getCollectionValueType() methods,
use Type::getCollectionKeyTypes() and Type::getCollectionValueTypes() instead
```
But we have these test failures:
```
App\Tests\Controller\Admin\BlogControllerTest::testAdminNewPost
Error: Call to undefined method Symfony\Component\PropertyInfo\Type::getCollectionValueTypes()
demo/vendor/symfony/validator/Mapping/Loader/PropertyInfoLoader.php:122
demo/vendor/symfony/validator/Mapping/Loader/LoaderChain.php:54
demo/vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php:101
demo/vendor/symfony/validator/Validator/RecursiveValidator.php:76
demo/vendor/symfony/validator/Validator/TraceableValidator.php:50
demo/vendor/symfony/form/Extension/Validator/ValidatorTypeGuesser.php:265
demo/vendor/symfony/form/Extension/Validator/ValidatorTypeGuesser.php:38
demo/vendor/symfony/form/FormTypeGuesserChain.php:47
demo/vendor/symfony/form/FormTypeGuesserChain.php:93
demo/vendor/symfony/form/FormTypeGuesserChain.php:48
demo/vendor/symfony/form/FormFactory.php:84
demo/vendor/symfony/form/FormBuilder.php:97
demo/vendor/symfony/form/FormBuilder.php:244
demo/vendor/symfony/form/FormBuilder.php:195
demo/vendor/symfony/form/FormFactory.php:28
demo/vendor/symfony/framework-bundle/Controller/AbstractController.php:359
demo/src/Controller/Admin/BlogController.php:78
demo/vendor/symfony/http-kernel/HttpKernel.php:157
demo/vendor/symfony/http-kernel/HttpKernel.php:79
demo/vendor/symfony/http-kernel/Kernel.php:196
demo/vendor/symfony/http-kernel/HttpKernelBrowser.php:63
demo/vendor/symfony/framework-bundle/KernelBrowser.php:159
demo/vendor/symfony/browser-kit/AbstractBrowser.php:402
demo/tests/Controller/Admin/BlogControllerTest.php:89
```
-----
### Unexpected direct deprecations
I see the following "direct deprecation" notices, but I don't know how they can be "direct deprecations". We don't use any of these in our code:
```
Remaining direct deprecation notices (7)
1x: Since symfony/security-core 5.3: The "Symfony\Component\Security\Core\Encoder\SodiumPasswordEncoder" class is deprecated, use "Symfony\Component\PasswordHasher\Hasher\SodiumPasswordHasher" instead.
1x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
1x: Since symfony/security-core 5.3: The "Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface" class is deprecated, use "Symfony\Component\PasswordHasher\PasswordHasherInterface" instead.
1x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
1x: Since symfony/security-core 5.3: The "Symfony\Component\Security\Core\Encoder\SelfSaltingEncoderInterface" interface is deprecated, use "Symfony\Component\PasswordHasher\LegacyPasswordHasherInterface" on hasher implementations that deal with salts instead.
1x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
1x: Since symfony/security-core 5.3: The "Symfony\Component\Security\Core\Encoder\Pbkdf2PasswordEncoder" class is deprecated, use "Symfony\Component\PasswordHasher\Hasher\Pbkdf2PasswordHasher" instead.
1x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
1x: Since symfony/security-core 5.3: The "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder" class is deprecated, use "Symfony\Component\PasswordHasher\Hasher\CheckPasswordLengthTrait" instead.
1x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
1x: Since symfony/security-core 5.3: The "Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder" class is deprecated, use "Symfony\Component\PasswordHasher\Hasher\MessageDigestPasswordHasher" instead.
1x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
1x: Since symfony/security-core 5.3: The "Symfony\Component\Security\Core\Encoder\MigratingPasswordEncoder" class is deprecated, use "Symfony\Component\PasswordHasher\Hasher\MigratingPasswordHasher" instead.
1x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
```
-----
### Indirect deprecations to fix?
There are still these "indirect deprecations". Are we missing some dependency updates ... or are these really deprecations pending to be fixed?
```
Remaining indirect deprecation notices (24)
19x: Since symfony/security-core 5.3: Not implementing method "loadUserByIdentifier()" in user provider "Symfony\Bridge\Doctrine\Security\User\EntityUserProvider" is deprecated. This method will replace "loadUserByUsername()" in Symfony 6.0.
4x in BlogControllerTest::testAccessDeniedForRegularUsers from App\Tests\Controller\Admin
4x in BlogControllerTest::testNewComment from App\Tests\Controller
2x in BlogControllerTest::testAdminDeletePost from App\Tests\Controller\Admin
2x in UserControllerTest::testEditUser from App\Tests\Controller
2x in UserControllerTest::testChangePassword from App\Tests\Controller
1x in BlogControllerTest::testAdminBackendHomePage from App\Tests\Controller\Admin
1x in BlogControllerTest::testAdminNewPost from App\Tests\Controller\Admin
1x in BlogControllerTest::testAdminNewDuplicatedPost from App\Tests\Controller\Admin
1x in BlogControllerTest::testAdminShowPost from App\Tests\Controller\Admin
1x in BlogControllerTest::testAdminEditPost from App\Tests\Controller\Admin
4x: Since symfony/http-foundation 5.3: "Symfony\Component\HttpFoundation\RequestStack::getMasterRequest()" is deprecated, use "getMainRequest()" instead.
4x in BlogControllerTest::testAccessDeniedForRegularUsers from App\Tests\Controller\Admin
1x: The "DAMA\DoctrineTestBundle\Doctrine\DBAL\AbstractStaticDriverV2" class implements "Doctrine\DBAL\Driver\ExceptionConverterDriver" that is deprecated.
1x in PHPUnitExtension::executeBeforeFirstTest from DAMA\DoctrineTestBundle\PHPUnit
Other deprecation notices (18)
7x: Since symfony/security-bundle 5.3: The "security.password_encoder" service is deprecated, use "security.user_password_hasher" instead.
2x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
2x in AddUserCommandTest::testCreateUserInteractive from App\Tests\Command
2x in UserControllerTest::testChangePassword from App\Tests\Controller
1x in UserControllerTest::testAccessDeniedForAnonymousUsers from App\Tests\Controller
7x: Since symfony/security-bundle 5.3: The "security.encoder_factory.generic" service is deprecated, use "security.password_hasher_factory" instead.
2x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
2x in AddUserCommandTest::testCreateUserInteractive from App\Tests\Command
2x in UserControllerTest::testChangePassword from App\Tests\Controller
1x in UserControllerTest::testAccessDeniedForAnonymousUsers from App\Tests\Controller
1x: Since symfony/security-core 5.3: The "Symfony\Component\Security\Core\Encoder\UserPasswordEncoder" class is deprecated, use "Symfony\Component\PasswordHasher\Hasher\UserPasswordHasher" instead.
1x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
1x: Since symfony/security-core 5.3: The "Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface" interface is deprecated, use "Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface" instead.
1x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
1x: Since symfony/security-core 5.3: The "Symfony\Component\Security\Core\Encoder\EncoderFactory" class is deprecated, use "Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactory" instead.
1x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
1x: Since symfony/security-core 5.3: The "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface" class is deprecated, use "Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface" instead.
1x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
```
Commits
-------
2a9c975 Serializable is banned
58822bd composer up
b0f5db5 Update assets/
cfeb771 Update code for 5.3
a410db9 Better constraints
b6d91b2 Removed most deprecations
997ce81 Updated to Symfony 5.3 RC1File tree
105 files changed
+2893
-2882
lines changed- .github/workflows
- assets
- controllers
- styles
- bin
- config
- packages
- dev
- prod
- test
- routes
- dev
- public
- build
- fonts
- images
- src
- Command
- Controller
- DataFixtures
- Entity
- EventSubscriber
- tests/Command
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
105 files changed
+2893
-2882
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | 25 | | |
| 26 | + | |
28 | 27 | | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Whitespace-only changes.
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
0 commit comments