Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for SonataBlockBundle 4.x #1023

Merged
merged 1 commit into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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` 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
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