forked from Snck3rs/contao-leaflet-maps
Code style issues.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
phpcs.standard = ${basedir}/vendor/phpcq/coding-standard/phpcs/PhpCodeQuality/ruleset.xml
|
||||
phpmd.ruleset = ${basedir}/vendor/phpcq/coding-standard/phpmd/ruleset.xml
|
||||
phpcs.excluded = src/Resources/contao/languages
|
||||
phpcs.excluded = src/Resources/contao/languages,src/Resources/public/js
|
||||
phpcpd.excluded = contao
|
||||
|
||||
@@ -15,16 +15,17 @@ declare(strict_types=1);
|
||||
namespace Netzmacht\Contao\Leaflet\Frontend\Assets;
|
||||
|
||||
use Contao\CoreBundle\Framework\ContaoFrameworkInterface as ContaoFramework;
|
||||
use Traversable;
|
||||
|
||||
/**
|
||||
* Class LibrariesConfiguration
|
||||
* Class LibrariesConfiguration.
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Frontend\Assets
|
||||
*/
|
||||
class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
||||
{
|
||||
/**
|
||||
* Contao framework.
|
||||
*
|
||||
* @var ContaoFramework
|
||||
*/
|
||||
private $framework;
|
||||
@@ -32,7 +33,7 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
||||
/**
|
||||
* LibrariesConfiguration constructor.
|
||||
*
|
||||
* @param ContaoFramework $framework
|
||||
* @param ContaoFramework $framework Contao framework.
|
||||
*/
|
||||
public function __construct(ContaoFramework $framework)
|
||||
{
|
||||
@@ -70,6 +71,8 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
$this->framework->initialize();
|
||||
|
||||
return $GLOBALS['LEAFLET_LIBRARIES'][$offset];
|
||||
}
|
||||
|
||||
@@ -80,6 +83,8 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
$this->framework->initialize();
|
||||
|
||||
$GLOBALS['LEAFLET_LIBRARIES'][$offset] = $value;
|
||||
}
|
||||
|
||||
@@ -90,6 +95,8 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
$this->framework->initialize();
|
||||
|
||||
unset($GLOBALS['LEAFLET_LIBRARIES'][$offset]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ class MapProvider
|
||||
* @param DefinitionMapper $mapper The definition mapper.
|
||||
* @param Leaflet $leaflet The Leaflet instance.
|
||||
* @param EventDispatcher $eventDispatcher The Contao event dispatcher.
|
||||
* @param Input $input Thw request input.
|
||||
* @param Input $input Thw request input.
|
||||
* @param ContaoAssets $assets Assets handler.
|
||||
* @param Cache $cache Cache.
|
||||
* @param array $filters Request filters configuration.
|
||||
|
||||
@@ -88,6 +88,7 @@ $GLOBALS['TL_MODELS']['tl_leaflet_vector'] = \Netzmacht\Contao\Leaflet\Model\Ve
|
||||
/*
|
||||
* Hooks.
|
||||
*/
|
||||
|
||||
$GLOBALS['TL_HOOKS']['initializeSystem'][] = [
|
||||
'netzmacht.contao_leaflet_maps.listeners.register_libraries',
|
||||
'onInitializeSystem'
|
||||
|
||||
Reference in New Issue
Block a user