Switch to PSR-4.

This commit is contained in:
David Molineus
2017-10-05 14:16:56 +02:00
parent e3344ffd4f
commit 827c746b0d
87 changed files with 4 additions and 6 deletions

View File

@@ -0,0 +1,29 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
namespace Netzmacht\Contao\Leaflet\Mapper\Style;
use Netzmacht\Contao\Leaflet\Mapper\AbstractTypeMapper;
/**
* Class AbstractStyleMapper is the base mapper for the style model.
*
* @package Netzmacht\Contao\Leaflet\Mapper\Style
*/
abstract class AbstractStyleMapper extends AbstractTypeMapper
{
/**
* Class of the model being build.
*
* @var string
*/
protected static $modelClass = 'Netzmacht\Contao\Leaflet\Model\StyleModel';
}

View File

@@ -0,0 +1,53 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
namespace Netzmacht\Contao\Leaflet\Mapper\Style;
use Netzmacht\LeafletPHP\Definition;
/**
* Class FixedStyleMapper maps the fixed style to the corresponding definition.
*
* @package Netzmacht\Contao\Leaflet\Mapper\Style
*/
class FixedStyleMapper extends AbstractStyleMapper
{
/**
* Definition class.
*
* @var string
*/
protected static $definitionClass = 'Netzmacht\Contao\Leaflet\Definition\Style\FixedStyle';
/**
* Style type.
*
* @var string
*/
protected static $type = 'fixed';
/**
* {@inheritdoc}
*/
protected function initialize()
{
parent::initialize();
$this->optionsBuilder
->addOptions('stroke', 'weight', 'opacity', 'clickable', 'className')
->addConditionalOption('color')
->addConditionalOption('lineCap')
->addConditionalOption('lineJoin')
->addConditionalOption('dashArray')
->addConditionalOptions('fill', array('fillColor', 'fillOpacity'))
->addOption('fill');
}
}