From 1fc47f705d0a92c09395e13137f6192254978c01 Mon Sep 17 00:00:00 2001 From: David Molineus Date: Fri, 6 Oct 2017 13:19:46 +0200 Subject: [PATCH] Rename listener namespace. --- .../Dca/LayerDcaListener.php} | 13 +++---------- src/{Listeners => Listener}/Dca/MapDcaListener.php | 2 +- src/Resources/config/listeners.yml | 4 ++-- src/Resources/contao/dca/tl_leaflet_control.php | 2 +- 4 files changed, 7 insertions(+), 14 deletions(-) rename src/{Dca/LayerCallbacks.php => Listener/Dca/LayerDcaListener.php} (97%) rename src/{Listeners => Listener}/Dca/MapDcaListener.php (98%) diff --git a/src/Dca/LayerCallbacks.php b/src/Listener/Dca/LayerDcaListener.php similarity index 97% rename from src/Dca/LayerCallbacks.php rename to src/Listener/Dca/LayerDcaListener.php index e739a2b..18f9f3c 100644 --- a/src/Dca/LayerCallbacks.php +++ b/src/Listener/Dca/LayerDcaListener.php @@ -10,9 +10,9 @@ * @filesource */ -namespace Netzmacht\Contao\Leaflet\Dca; +namespace Netzmacht\Contao\Leaflet\Listener\Dca; -use Netzmacht\Contao\Toolkit\Dca\Callback\Callbacks; +use Netzmacht\Contao\Toolkit\Dca\Listener\AbstractListener; use Netzmacht\Contao\Toolkit\Dca\Manager; use Netzmacht\Contao\Toolkit\Dca\Options\OptionsBuilder; use Netzmacht\Contao\Leaflet\Model\LayerModel; @@ -23,7 +23,7 @@ use Symfony\Component\Translation\TranslatorInterface as Translator; * * @package Netzmacht\Contao\Leaflet\Dca */ -class LayerCallbacks extends Callbacks +class LayerDcaListener extends AbstractListener { /** * Name of the data container. @@ -32,13 +32,6 @@ class LayerCallbacks extends Callbacks */ protected static $name = 'tl_leaflet_layer'; - /** - * Helper service name. - * - * @var string - */ - protected static $serviceName = 'leaflet.dca.layer-callbacks'; - /** * Layers definition. * diff --git a/src/Listeners/Dca/MapDcaListener.php b/src/Listener/Dca/MapDcaListener.php similarity index 98% rename from src/Listeners/Dca/MapDcaListener.php rename to src/Listener/Dca/MapDcaListener.php index a09776f..a8f5037 100644 --- a/src/Listeners/Dca/MapDcaListener.php +++ b/src/Listener/Dca/MapDcaListener.php @@ -12,7 +12,7 @@ declare(strict_types=1); -namespace Netzmacht\Contao\Leaflet\Listeners\Dca; +namespace Netzmacht\Contao\Leaflet\Listener\Dca; use Contao\DataContainer; use Doctrine\DBAL\Connection; diff --git a/src/Resources/config/listeners.yml b/src/Resources/config/listeners.yml index 721e3ae..8f8beee 100644 --- a/src/Resources/config/listeners.yml +++ b/src/Resources/config/listeners.yml @@ -1,12 +1,12 @@ services: netzmacht.contao_leaflet_maps.listeners.dca.map: - class: Netzmacht\Contao\Leaflet\Listeners\Dca\MapDcaListener + class: Netzmacht\Contao\Leaflet\Listener\Dca\MapDcaListener arguments: - '@netzmacht.contao_toolkit.dca.manager' - '@database_connection' netzmacht.contao_leaflet_maps.listeners.dca.control: - class: Netzmacht\Contao\Leaflet\Listeners\Dca\ControlDcaListener + class: Netzmacht\Contao\Leaflet\Listener\Dca\ControlDcaListener arguments: - '@netzmacht.contao_toolkit.dca.manager' - '@database_connection' diff --git a/src/Resources/contao/dca/tl_leaflet_control.php b/src/Resources/contao/dca/tl_leaflet_control.php index 88c10a3..96e4a81 100644 --- a/src/Resources/contao/dca/tl_leaflet_control.php +++ b/src/Resources/contao/dca/tl_leaflet_control.php @@ -301,7 +301,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['layer'], 'exclude' => true, 'inputType' => 'select', - 'options_callback' => \Netzmacht\Contao\Leaflet\Listeners\Dca\ControlDcaListener::callback('getLayers'), + 'options_callback' => \Netzmacht\Contao\Leaflet\Listener\Dca\ControlDcaListener::callback('getLayers'), 'eval' => array( 'style' => 'width: 300px', 'chosen' => true,