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 <[email protected]>
  • Loading branch information
wbloszyk and greg0ire committed Aug 19, 2020
1 parent 5978634 commit 5a66b64
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
Original file line number Diff line number Diff line change
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` on 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
use Twig\Environment;

/**
* @final since sonata-project/doctrine-orm-admin-bundle 3.x
*
* @author Thomas Rabaix <[email protected]>
*/
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 5a66b64

Please sign in to comment.