diff --git a/UPGRADE-3.x.md b/UPGRADE-3.x.md index c12eb68ae..a171526a2 100644 --- a/UPGRADE-3.x.md +++ b/UPGRADE-3.x.md @@ -4,6 +4,13 @@ UPGRADE 3.x UPGRADE FROM 3.x to 3.x ========================= +### Compatibility with SonataBlockBundle 4.0 + +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()`. + ### Sonata\DoctrineORMAdminBundle\Model\ModelManager Deprecated `camelize()` method with no replacement. diff --git a/composer.json b/composer.json index 631dbdd82..dfc07612c 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,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..e111bb571 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 = []; @@ -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,