Code style issues.

This commit is contained in:
David Molineus
2017-10-09 15:49:38 +02:00
parent fab9b5a0ba
commit 249b12cb61
4 changed files with 13 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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