forked from Snck3rs/contao-leaflet-maps
Bump requirements and fix symfony/event-dispatcher usage
This commit is contained in:
@@ -21,9 +21,9 @@
|
|||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-pdo": "*",
|
"ext-pdo": "*",
|
||||||
"contao-community-alliance/meta-palettes": "^2.0 || ^1.11",
|
"contao-community-alliance/meta-palettes": "^2.0 || ^1.11",
|
||||||
"contao/core-bundle": "~4.4",
|
"contao/core-bundle": "^4.9",
|
||||||
"doctrine/cache": "^1.0",
|
"doctrine/cache": "^1.0",
|
||||||
"doctrine/dbal": "^2.5",
|
"doctrine/dbal": "^2.11 || ^3.0",
|
||||||
"menatwork/contao-multicolumnwizard": "^3.3",
|
"menatwork/contao-multicolumnwizard": "^3.3",
|
||||||
"netzmacht/contao-leaflet-geocode-widget": "^1.2",
|
"netzmacht/contao-leaflet-geocode-widget": "^1.2",
|
||||||
"netzmacht/contao-leaflet-libraries": "^1.3.4",
|
"netzmacht/contao-leaflet-libraries": "^1.3.4",
|
||||||
@@ -31,14 +31,15 @@
|
|||||||
"netzmacht/contao-toolkit": "~3.0",
|
"netzmacht/contao-toolkit": "~3.0",
|
||||||
"netzmacht/php-javascript-builder": "^1.0",
|
"netzmacht/php-javascript-builder": "^1.0",
|
||||||
"netzmacht/php-leaflet": "^1.1.0",
|
"netzmacht/php-leaflet": "^1.1.0",
|
||||||
"symfony/config": "~3.3 || ~4.0",
|
"symfony/config": "~4.4 || ^5.1",
|
||||||
"symfony/dependency-injection": "^3.4.26 || ^4.1.12",
|
"symfony/dependency-injection": "~4.4 || ^5.1",
|
||||||
"symfony/event-dispatcher": "~3.3 || ~4.0",
|
"symfony/event-dispatcher": "~4.4 || ^5.1",
|
||||||
"symfony/filesystem": "~3.3 || ~4.0",
|
"symfony/event-dispatcher-contracts": "^1.1 || ^2.0",
|
||||||
"symfony/http-kernel": "~3.3 || ~4.0",
|
"symfony/filesystem": "~4.4 || ^5.1",
|
||||||
"symfony/twig-bundle": "~3.3 || ~4.0",
|
"symfony/http-kernel": "~4.4 || ^5.1",
|
||||||
"symfony/translation": "~3.3 || ~4.0",
|
"symfony/twig-bundle": "~4.4 || ^5.1",
|
||||||
"twig/twig": "^1.3.35 || ^2.0"
|
"symfony/translation": "~4.4 || ^5.1",
|
||||||
|
"twig/twig": "^2.0 || ^3.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"contao/manager-plugin": "^2.1",
|
"contao/manager-plugin": "^2.1",
|
||||||
@@ -79,5 +80,12 @@
|
|||||||
"issues": "https://github.com/netzmacht/contao-leaflet-maps/issues",
|
"issues": "https://github.com/netzmacht/contao-leaflet-maps/issues",
|
||||||
"source": "https://github.com/netzmacht/contao-leaflet-maps",
|
"source": "https://github.com/netzmacht/contao-leaflet-maps",
|
||||||
"docs": "http://leaflet-maps-for-contao.readthedocs.org/"
|
"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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace Netzmacht\Contao\Leaflet\Event;
|
|||||||
use Contao\Model;
|
use Contao\Model;
|
||||||
use Netzmacht\Contao\Leaflet\Mapper\Request;
|
use Netzmacht\Contao\Leaflet\Mapper\Request;
|
||||||
use Netzmacht\LeafletPHP\Definition;
|
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.
|
* 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\Definition;
|
||||||
use Netzmacht\LeafletPHP\Value\GeoJson\GeoJsonObject;
|
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.
|
* Class ConvertToGeoJsonEvent is emitted when the DefinitionMapper converts a definition to a geo json feature.
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
namespace Netzmacht\Contao\Leaflet\Event;
|
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.
|
* 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;
|
namespace Netzmacht\Contao\Leaflet\Event;
|
||||||
|
|
||||||
use Netzmacht\LeafletPHP\Definition\Map;
|
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.
|
* 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\Definition\Map;
|
||||||
use Netzmacht\LeafletPHP\Leaflet;
|
use Netzmacht\LeafletPHP\Leaflet;
|
||||||
use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection;
|
use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface as EventDispatcher;
|
|
||||||
use Symfony\Component\Templating\EngineInterface as TemplateEngine;
|
use Symfony\Component\Templating\EngineInterface as TemplateEngine;
|
||||||
|
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as EventDispatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class MapProvider.
|
* Class MapProvider.
|
||||||
@@ -392,7 +392,7 @@ class MapProvider
|
|||||||
);
|
);
|
||||||
|
|
||||||
$event = new GetJavascriptEvent($definition, $content);
|
$event = new GetJavascriptEvent($definition, $content);
|
||||||
$this->eventDispatcher->dispatch($event::NAME, $event);
|
$this->eventDispatcher->dispatch($event, $event::NAME);
|
||||||
|
|
||||||
return $event->getJavascript();
|
return $event->getJavascript();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ use Netzmacht\LeafletPHP\Value\GeoJson\ConvertsToGeoJsonFeature;
|
|||||||
use Netzmacht\LeafletPHP\Value\GeoJson\Feature;
|
use Netzmacht\LeafletPHP\Value\GeoJson\Feature;
|
||||||
use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection;
|
use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection;
|
||||||
use Netzmacht\LeafletPHP\Value\GeoJson\GeoJsonFeature;
|
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.
|
* Class DefinitionMapper is the main mapper instance which contains all other mappers as children.
|
||||||
@@ -111,7 +111,7 @@ class DefinitionMapper
|
|||||||
|
|
||||||
if ($definition) {
|
if ($definition) {
|
||||||
$event = new BuildDefinitionEvent($definition, $model, $request);
|
$event = new BuildDefinitionEvent($definition, $model, $request);
|
||||||
$this->eventDispatcher->dispatch($event::NAME, $event);
|
$this->eventDispatcher->dispatch($event, $event::NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->mapped[$hash] = $definition;
|
$this->mapped[$hash] = $definition;
|
||||||
@@ -172,7 +172,7 @@ class DefinitionMapper
|
|||||||
}
|
}
|
||||||
|
|
||||||
$event = new ConvertToGeoJsonEvent($definition, $feature, $model);
|
$event = new ConvertToGeoJsonEvent($definition, $feature, $model);
|
||||||
$this->eventDispatcher->dispatch($event::NAME, $event);
|
$this->eventDispatcher->dispatch($event, $event::NAME);
|
||||||
|
|
||||||
return $feature;
|
return $feature;
|
||||||
}
|
}
|
||||||
@@ -190,7 +190,7 @@ class DefinitionMapper
|
|||||||
private function hash($model, $elementId = null)
|
private function hash($model, $elementId = null)
|
||||||
{
|
{
|
||||||
$event = new GetHashEvent($model);
|
$event = new GetHashEvent($model);
|
||||||
$this->eventDispatcher->dispatch($event::NAME, $event);
|
$this->eventDispatcher->dispatch($event, $event::NAME);
|
||||||
$hash = $event->getHash();
|
$hash = $event->getHash();
|
||||||
|
|
||||||
if (!$hash) {
|
if (!$hash) {
|
||||||
|
|||||||
Reference in New Issue
Block a user