Skip to content

Commit

Permalink
Add support for SonataBlockBundle 4.x
Browse files Browse the repository at this point in the history
Update UPGRADE-3.x.md

Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>

Update UPGRADE-3.x.md

Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
  • Loading branch information
wbloszyk and greg0ire committed Aug 19, 2020
1 parent 5978634 commit b4a30b3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 7 additions & 0 deletions UPGRADE-3.x.md
Expand Up @@ -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` in your composer.json in order to avoid unwanted upgrades.

There is a minimal BC Break on `AuditBlockService`. If you are extending this 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.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -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": {
Expand Down
6 changes: 4 additions & 2 deletions src/Block/AuditBlockService.php
Expand Up @@ -24,6 +24,8 @@
use Twig\Environment;

/**
* @final since sonata-project/doctrine-orm-admin-bundle 3.x
*
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
*/
class AuditBlockService extends AbstractBlockService
Expand Down Expand Up @@ -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 = [];

Expand All @@ -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,
Expand Down

0 comments on commit b4a30b3

Please sign in to comment.