Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
Merge 73e259a into ab0fc65
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Feb 18, 2020
2 parents ab0fc65 + 73e259a commit d9bb036
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions composer.json
Expand Up @@ -22,12 +22,14 @@
],
"require": {
"php": "^7.1",
"doctrine/doctrine-bundle": "^1.12 || ^2.0",
"sonata-project/core-bundle": "^3.9",
"sonata-project/datagrid-bundle": "^2.5",
"sonata-project/doctrine-extensions": "^1.5",
"symfony/config": "^4.4",
"symfony/console": "^4.4",
"symfony/dependency-injection": "^4.4",
"symfony/doctrine-bridge": "^4.4",
"symfony/event-dispatcher": "^4.4",
"symfony/event-dispatcher-contracts": "^1.1",
"symfony/form": "^4.4",
Expand Down
4 changes: 2 additions & 2 deletions src/Event/DoctrineBackendOptimizeListener.php
Expand Up @@ -14,7 +14,7 @@
namespace Sonata\NotificationBundle\Event;

use Doctrine\Bundle\DoctrineBundle\Registry;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Doctrine\Persistence\ManagerRegistry;

/**
* Doctrine context optimizer
Expand All @@ -29,7 +29,7 @@ class DoctrineBackendOptimizeListener implements IterationListener
*/
protected $doctrine;

public function __construct(RegistryInterface $doctrine)
public function __construct(ManagerRegistry $doctrine)
{
$this->doctrine = $doctrine;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Event/DoctrineOptimizeListener.php
Expand Up @@ -13,7 +13,7 @@

namespace Sonata\NotificationBundle\Event;

use Symfony\Bridge\Doctrine\RegistryInterface;
use Doctrine\Persistence\ManagerRegistry;

/**
* Doctrine context optimizer
Expand All @@ -29,7 +29,7 @@ class DoctrineOptimizeListener implements IterationListener
*/
protected $doctrine;

public function __construct(RegistryInterface $doctrine)
public function __construct(ManagerRegistry $doctrine)
{
$this->doctrine = $doctrine;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Event/DoctrineOptimizeListenerTest.php
Expand Up @@ -20,7 +20,7 @@
use Sonata\NotificationBundle\Event\DoctrineOptimizeListener;
use Sonata\NotificationBundle\Event\IterateEvent;
use Sonata\NotificationBundle\Iterator\MessageIteratorInterface;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Doctrine\Persistence\ManagerRegistry;

class DoctrineOptimizeListenerTest extends TestCase
{
Expand All @@ -31,7 +31,7 @@ public function testWithClosedManager()
$manager = $this->createMock(EntityManager::class);
$manager->expects($this->once())->method('isOpen')->willReturn(false);

$registry = $this->createMock(RegistryInterface::class);
$registry = $this->createMock(ManagerRegistry::class);
$registry->expects($this->once())->method('getManagers')->willReturn([
'default' => $manager,
]);
Expand All @@ -52,7 +52,7 @@ public function testOptimize()
$manager->expects($this->once())->method('isOpen')->willReturn(true);
$manager->expects($this->once())->method('getUnitOfWork')->willReturn($unitofwork);

$registry = $this->createMock(RegistryInterface::class);
$registry = $this->createMock(ManagerRegistry::class);
$registry->expects($this->once())->method('getManagers')->willReturn([
'default' => $manager,
]);
Expand Down

0 comments on commit d9bb036

Please sign in to comment.