diff --git a/UPGRADE-3.x.md b/UPGRADE-3.x.md index bb4f36710..acea37e3f 100644 --- a/UPGRADE-3.x.md +++ b/UPGRADE-3.x.md @@ -1,6 +1,14 @@ UPGRADE 3.x =========== +UPGRADE FROM 3.21 to 3.22 +========================= + +We added compatibility with SonataBlockBundle 4.0, make sure you are explicitly declaring your dependency +with `sonata-project/block-bundle` on your composer.json in order to avoid unwanted upgrades. + +There is a minimal BC Break on `AuditBlockService`. If you are extending those class (keep in mind that it will become final on 4.0) you should add return type hints to `execute()` and `configureSettings()`. + UPGRADE FROM 3.20 to 3.21 ========================= diff --git a/composer.json b/composer.json index c70a36ecc..d774d017e 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ }, "require-dev": { "simplethings/entity-audit-bundle": "^0.9 || ^1.0", - "sonata-project/block-bundle": "^3.17", + "sonata-project/block-bundle": "^3.17 || ^4.0", "symfony/phpunit-bridge": "^5.0" }, "suggest": { diff --git a/src/Block/AuditBlockService.php b/src/Block/AuditBlockService.php index 18c45bd03..21030bc96 100644 --- a/src/Block/AuditBlockService.php +++ b/src/Block/AuditBlockService.php @@ -24,6 +24,8 @@ use Twig\Environment; /** + * @final since sonata-project/doctrine-orm-admin-bundle 3.x + * * @author Thomas Rabaix */ class AuditBlockService extends AbstractBlockService @@ -92,7 +94,7 @@ public function __construct($templatingOrDeprecatedName, object $templatingOrAud } } - public function execute(BlockContextInterface $blockContext, ?Response $response = null) + public function execute(BlockContextInterface $blockContext, ?Response $response = null): Response { $revisions = []; @@ -110,7 +112,7 @@ public function execute(BlockContextInterface $blockContext, ?Response $response ], $response); } - public function buildEditForm(FormMapper $formMapper, BlockInterface $block) + public function buildEditForm(FormMapper $formMapper, BlockInterface $block): void { } @@ -119,7 +121,7 @@ public function getName() return 'Audit List'; } - public function configureSettings(OptionsResolver $resolver) + public function configureSettings(OptionsResolver $resolver): void { $resolver->setDefaults([ 'limit' => 10,