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

Production #7

Open
wants to merge 2 commits into
base: production
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
- 2019-06-27
* Fix Deprecation errors with Symfony 4+

- 2017-01-22
* Add `graceful_max_execution_timeout`

Expand Down
2 changes: 1 addition & 1 deletion Event/AMQPEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use OldSound\RabbitMqBundle\RabbitMq\Consumer;
use PhpAmqpLib\Message\AMQPMessage;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;

/**
* Class AMQPEvent
Expand Down
12 changes: 8 additions & 4 deletions RabbitMq/BaseAmqp.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as ContactsEventDispatcherInterface;

abstract class BaseAmqp
{
Expand Down Expand Up @@ -285,10 +286,13 @@ public function setEventDispatcher(EventDispatcherInterface $eventDispatcher)
protected function dispatchEvent($eventName, AMQPEvent $event)
{
if ($this->getEventDispatcher()) {
$this->getEventDispatcher()->dispatch(
$eventName,
$event
);
if ($this->getEventDispatcher() instanceof ContactsEventDispatcherInterface) {
$this->getEventDispatcher()
->dispatch($event, $eventName);
} else {
$this->getEventDispatcher()
->dispatch($eventName, $event);
}
}
}

Expand Down