Skip to content

Commit

Permalink
minor #34517 [Messenger] compatibility with DoctrineBundle 2 (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] compatibility with DoctrineBundle 2

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34514, doctrine/DoctrineBundle#1062
| License       | MIT
| Doc PR        |

Commits
-------

6ff20f0 compatibility with DoctrineBundle 2
  • Loading branch information
fabpot committed Nov 22, 2019
2 parents 996d8a7 + 6ff20f0 commit 860f96c
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Messenger\Transport\Doctrine;

use Doctrine\Common\Persistence\ConnectionRegistry;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Symfony\Component\Messenger\Exception\TransportException;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
Expand All @@ -26,8 +27,12 @@ class DoctrineTransportFactory implements TransportFactoryInterface
{
private $registry;

public function __construct(RegistryInterface $registry)
public function __construct($registry)
{
if (!$registry instanceof RegistryInterface && !$registry instanceof ConnectionRegistry) {
throw new \TypeError(sprintf('Expected an instance of %s or %s, but got %s.', RegistryInterface::class, ConnectionRegistry::class, \is_object($registry) ? \get_class($registry) : \gettype($registry)));
}

$this->registry = $registry;
}

Expand Down

0 comments on commit 860f96c

Please sign in to comment.