mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2026-02-28 09:08:14 +01:00
Bump requirements and fix symfony/event-dispatcher usage
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Netzmacht\Contao\Leaflet\Event;
|
||||
use Contao\Model;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\Request;
|
||||
use Netzmacht\LeafletPHP\Definition;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Class BuildDefinitionEvent is emitted when the mapper maps between the model and the definition.
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Netzmacht\Contao\Leaflet\Event;
|
||||
|
||||
use Netzmacht\LeafletPHP\Definition;
|
||||
use Netzmacht\LeafletPHP\Value\GeoJson\GeoJsonObject;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Class ConvertToGeoJsonEvent is emitted when the DefinitionMapper converts a definition to a geo json feature.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Event;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Class GetHashEvent is emitted then a hash for a data object with an unknown type is required.
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
namespace Netzmacht\Contao\Leaflet\Event;
|
||||
|
||||
use Netzmacht\LeafletPHP\Definition\Map;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Class GetJavascriptEvent is emitted after the map javascript was created.
|
||||
|
||||
@@ -27,8 +27,8 @@ use Netzmacht\Contao\Toolkit\View\Template\TemplateReference;
|
||||
use Netzmacht\LeafletPHP\Definition\Map;
|
||||
use Netzmacht\LeafletPHP\Leaflet;
|
||||
use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface as EventDispatcher;
|
||||
use Symfony\Component\Templating\EngineInterface as TemplateEngine;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as EventDispatcher;
|
||||
|
||||
/**
|
||||
* Class MapProvider.
|
||||
@@ -392,7 +392,7 @@ class MapProvider
|
||||
);
|
||||
|
||||
$event = new GetJavascriptEvent($definition, $content);
|
||||
$this->eventDispatcher->dispatch($event::NAME, $event);
|
||||
$this->eventDispatcher->dispatch($event, $event::NAME);
|
||||
|
||||
return $event->getJavascript();
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user