Bump requirements and fix symfony/event-dispatcher usage

This commit is contained in:
David Molineus
2022-02-21 16:31:52 +01:00
parent f2584d400c
commit d6a7e14a05
7 changed files with 28 additions and 20 deletions

View File

@@ -20,7 +20,7 @@ use Netzmacht\LeafletPHP\Value\GeoJson\ConvertsToGeoJsonFeature;
use Netzmacht\LeafletPHP\Value\GeoJson\Feature;
use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection;
use Netzmacht\LeafletPHP\Value\GeoJson\GeoJsonFeature;
use Symfony\Component\EventDispatcher\EventDispatcherInterface as EventDispatcher;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as EventDispatcher;
/**
* Class DefinitionMapper is the main mapper instance which contains all other mappers as children.
@@ -111,7 +111,7 @@ class DefinitionMapper
if ($definition) {
$event = new BuildDefinitionEvent($definition, $model, $request);
$this->eventDispatcher->dispatch($event::NAME, $event);
$this->eventDispatcher->dispatch($event, $event::NAME);
}
$this->mapped[$hash] = $definition;
@@ -172,7 +172,7 @@ class DefinitionMapper
}
$event = new ConvertToGeoJsonEvent($definition, $feature, $model);
$this->eventDispatcher->dispatch($event::NAME, $event);
$this->eventDispatcher->dispatch($event, $event::NAME);
return $feature;
}
@@ -190,7 +190,7 @@ class DefinitionMapper
private function hash($model, $elementId = null)
{
$event = new GetHashEvent($model);
$this->eventDispatcher->dispatch($event::NAME, $event);
$this->eventDispatcher->dispatch($event, $event::NAME);
$hash = $event->getHash();
if (!$hash) {