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

@@ -21,9 +21,9 @@
"ext-json": "*",
"ext-pdo": "*",
"contao-community-alliance/meta-palettes": "^2.0 || ^1.11",
"contao/core-bundle": "~4.4",
"contao/core-bundle": "^4.9",
"doctrine/cache": "^1.0",
"doctrine/dbal": "^2.5",
"doctrine/dbal": "^2.11 || ^3.0",
"menatwork/contao-multicolumnwizard": "^3.3",
"netzmacht/contao-leaflet-geocode-widget": "^1.2",
"netzmacht/contao-leaflet-libraries": "^1.3.4",
@@ -31,14 +31,15 @@
"netzmacht/contao-toolkit": "~3.0",
"netzmacht/php-javascript-builder": "^1.0",
"netzmacht/php-leaflet": "^1.1.0",
"symfony/config": "~3.3 || ~4.0",
"symfony/dependency-injection": "^3.4.26 || ^4.1.12",
"symfony/event-dispatcher": "~3.3 || ~4.0",
"symfony/filesystem": "~3.3 || ~4.0",
"symfony/http-kernel": "~3.3 || ~4.0",
"symfony/twig-bundle": "~3.3 || ~4.0",
"symfony/translation": "~3.3 || ~4.0",
"twig/twig": "^1.3.35 || ^2.0"
"symfony/config": "~4.4 || ^5.1",
"symfony/dependency-injection": "~4.4 || ^5.1",
"symfony/event-dispatcher": "~4.4 || ^5.1",
"symfony/event-dispatcher-contracts": "^1.1 || ^2.0",
"symfony/filesystem": "~4.4 || ^5.1",
"symfony/http-kernel": "~4.4 || ^5.1",
"symfony/twig-bundle": "~4.4 || ^5.1",
"symfony/translation": "~4.4 || ^5.1",
"twig/twig": "^2.0 || ^3.0"
},
"require-dev": {
"contao/manager-plugin": "^2.1",
@@ -79,5 +80,12 @@
"issues": "https://github.com/netzmacht/contao-leaflet-maps/issues",
"source": "https://github.com/netzmacht/contao-leaflet-maps",
"docs": "http://leaflet-maps-for-contao.readthedocs.org/"
},
"config": {
"allow-plugins": {
"contao-components/installer": true,
"contao/manager-plugin": true,
"contao-community-alliance/composer-plugin": true
}
}
}

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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();
}

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) {