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
|
phpcs.standard = ${basedir}/vendor/phpcq/coding-standard/phpcs/PhpCodeQuality/ruleset.xml
|
||||||
phpmd.ruleset = ${basedir}/vendor/phpcq/coding-standard/phpmd/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
|
phpcpd.excluded = contao
|
||||||
|
|||||||
@@ -15,16 +15,17 @@ declare(strict_types=1);
|
|||||||
namespace Netzmacht\Contao\Leaflet\Frontend\Assets;
|
namespace Netzmacht\Contao\Leaflet\Frontend\Assets;
|
||||||
|
|
||||||
use Contao\CoreBundle\Framework\ContaoFrameworkInterface as ContaoFramework;
|
use Contao\CoreBundle\Framework\ContaoFrameworkInterface as ContaoFramework;
|
||||||
use Traversable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class LibrariesConfiguration
|
* Class LibrariesConfiguration.
|
||||||
*
|
*
|
||||||
* @package Netzmacht\Contao\Leaflet\Frontend\Assets
|
* @package Netzmacht\Contao\Leaflet\Frontend\Assets
|
||||||
*/
|
*/
|
||||||
class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
* Contao framework.
|
||||||
|
*
|
||||||
* @var ContaoFramework
|
* @var ContaoFramework
|
||||||
*/
|
*/
|
||||||
private $framework;
|
private $framework;
|
||||||
@@ -32,7 +33,7 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
|||||||
/**
|
/**
|
||||||
* LibrariesConfiguration constructor.
|
* LibrariesConfiguration constructor.
|
||||||
*
|
*
|
||||||
* @param ContaoFramework $framework
|
* @param ContaoFramework $framework Contao framework.
|
||||||
*/
|
*/
|
||||||
public function __construct(ContaoFramework $framework)
|
public function __construct(ContaoFramework $framework)
|
||||||
{
|
{
|
||||||
@@ -70,6 +71,8 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function offsetGet($offset)
|
public function offsetGet($offset)
|
||||||
{
|
{
|
||||||
|
$this->framework->initialize();
|
||||||
|
|
||||||
return $GLOBALS['LEAFLET_LIBRARIES'][$offset];
|
return $GLOBALS['LEAFLET_LIBRARIES'][$offset];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,6 +83,8 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function offsetSet($offset, $value)
|
public function offsetSet($offset, $value)
|
||||||
{
|
{
|
||||||
|
$this->framework->initialize();
|
||||||
|
|
||||||
$GLOBALS['LEAFLET_LIBRARIES'][$offset] = $value;
|
$GLOBALS['LEAFLET_LIBRARIES'][$offset] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,6 +95,8 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function offsetUnset($offset)
|
public function offsetUnset($offset)
|
||||||
{
|
{
|
||||||
|
$this->framework->initialize();
|
||||||
|
|
||||||
unset($GLOBALS['LEAFLET_LIBRARIES'][$offset]);
|
unset($GLOBALS['LEAFLET_LIBRARIES'][$offset]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ $GLOBALS['TL_MODELS']['tl_leaflet_vector'] = \Netzmacht\Contao\Leaflet\Model\Ve
|
|||||||
/*
|
/*
|
||||||
* Hooks.
|
* Hooks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$GLOBALS['TL_HOOKS']['initializeSystem'][] = [
|
$GLOBALS['TL_HOOKS']['initializeSystem'][] = [
|
||||||
'netzmacht.contao_leaflet_maps.listeners.register_libraries',
|
'netzmacht.contao_leaflet_maps.listeners.register_libraries',
|
||||||
'onInitializeSystem'
|
'onInitializeSystem'
|
||||||
|
|||||||
Reference in New Issue
Block a user