Drop older doctrine persistence, allow collections 2.0, update psalm, incresing it to level 2 and avoid deprecations#889
Conversation
| /** | ||
| * @return array<array-key, string> | ||
| * | ||
| * @phpstan-param Options<array{ |
There was a problem hiding this comment.
Do you know if this can be done better @VincentLanglet ?
PHPStan understand the options param has 2 keys, but it is unable to know that 'context' will be ContextInterface or null. It is mixing keys and values.
There was a problem hiding this comment.
I think I saw it, the issue opened by you: phpstan/phpstan-symfony#322
There was a problem hiding this comment.
We might supress the issues raised, and wait for a fix on phpstan side.
|
|
||
| $parent = $category->getParent(); | ||
| if (null !== $parent) { | ||
| $parent->addChild($category); |
There was a problem hiding this comment.
This should have been removed when we deprecated/removed the disableLazyChildren collection here: #765
|
|
||
| if (null !== $contextId) { | ||
| $queryBuilder->andWhere('c.context = :context')->setParameter('context', $contextId, Types::OBJECT); | ||
| $queryBuilder->andWhere('c.context = :context')->setParameter('context', $contextId); |
There was a problem hiding this comment.
This was failing when trying to query with a non mocked CategoryManager on CategoryManagerTest, wdyt? ContextId is not an object, but a string.
|
|
||
| $parent = $category->getParent(); | ||
| if (null !== $parent) { | ||
| $parent->addChild($category); |
There was a problem hiding this comment.
same as the other lazy comment.
| @@ -1,10 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
There was a problem hiding this comment.
Those skeletons were used by the EasyExtends bundle, should have been removed by 4.0
| ], $fieldOptions); | ||
|
|
||
| return $formMapper->create($formField, ModelListType::class, $fieldOptions); | ||
| return $formMapper->getFormBuilder()->create($formField, ModelListType::class, $fieldOptions); |
There was a problem hiding this comment.
Here I am trying to avoid the deprecated call to ->create(). Following same strategy as we did for blocks on PageBundle: https://github.com/sonata-project/SonataPageBundle/blob/4.x/src/Block/SharedBlockBlockService.php#L148
There is not an easy way to test if the whole block works or not, but I think I will leave it for a follow up PR. My guess is that those blocks does not work, with or without this PR.
Subject
I am targeting this branch, because this should be BC and probably fix at least one bug.
Changelog