forked from egeloen/ivory-google-map
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from thorau/feature/fix-deprecations-of-event-d…
…ispatching fixed deprecations of event dispatching
- Loading branch information
Showing
5 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
namespace Ivory\GoogleMap\Helper; | ||
|
||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy; | ||
|
||
/** | ||
* @author GeLo <[email protected]> | ||
|
@@ -41,6 +42,6 @@ public function getEventDispatcher() | |
*/ | ||
public function setEventDispatcher($eventDispatcher) | ||
{ | ||
$this->eventDispatcher = $eventDispatcher; | ||
$this->eventDispatcher = LegacyEventDispatcherProxy::decorate($eventDispatcher); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
use Ivory\GoogleMap\Helper\Subscriber\DelegateSubscriberInterface; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy; | ||
|
||
/** | ||
* @author GeLo <[email protected]> | ||
|
@@ -26,11 +27,13 @@ class StaticSubscriber implements DelegateSubscriberInterface | |
*/ | ||
public function handle(Event $event, $eventName, EventDispatcherInterface $eventDispatcher) | ||
{ | ||
$dispatcher = LegacyEventDispatcherProxy::decorate($eventDispatcher); | ||
|
||
$delegates = static::getDelegatedSubscribedEvents(); | ||
|
||
if (isset($delegates[$eventName])) { | ||
if (isset($delegates[$eventName]) && $dispatcher !== null) { | ||
foreach ($delegates[$eventName] as $delegate) { | ||
$eventDispatcher->dispatch($delegate, $event); | ||
$dispatcher->dispatch($event, $delegate); | ||
} | ||
} | ||
} | ||
|