mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-28 19:13:55 +01:00
Code style.
This commit is contained in:
@@ -84,9 +84,10 @@ class Marker
|
||||
|
||||
$values = trimsplit(',', $value);
|
||||
$keys = array_keys($combined);
|
||||
$count = count($values);
|
||||
|
||||
if (count($values) >= 2 && count($values) <= 3) {
|
||||
for ($i = 0; $i < count($values); $i++) {
|
||||
if ($count >= 2 && $count <= 3) {
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$combined[$keys[$i]] = $values[$i];
|
||||
}
|
||||
}
|
||||
@@ -106,6 +107,8 @@ class Marker
|
||||
* @param \DataContainer $dataContainer The data container driver.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function loadCoordinates($value, $dataContainer)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ class BboxFilter implements Filter
|
||||
/**
|
||||
* Construct.
|
||||
*
|
||||
* @param \Netzmacht\LeafletPHP\Value\LatLngBounds $bounds The bounds.
|
||||
* @param LatLngBounds $bounds The bounds.
|
||||
*/
|
||||
public function __construct(LatLngBounds $bounds)
|
||||
{
|
||||
|
||||
@@ -109,7 +109,7 @@ class MapService
|
||||
* Get map javascript.
|
||||
*
|
||||
* @param MapModel|int $mapId The map database id. MapModel accepted as well.
|
||||
* @param \Netzmacht\LeafletPHP\Value\LatLngBounds $bounds Optional bounds where elements should be in.
|
||||
* @param LatLngBounds $bounds Optional bounds where elements should be in.
|
||||
* @param string $elementId Optional element id. If none given the mapId or alias is used.
|
||||
* @param string $template The template being used for generating.
|
||||
* @param string $style Optional style attributes.
|
||||
|
||||
@@ -144,8 +144,8 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
|
||||
/**
|
||||
* Load all layer markers.
|
||||
*
|
||||
* @param \Model $model The layer model.
|
||||
* @param Filter $filter null The request filter.
|
||||
* @param \Model $model The layer model.
|
||||
* @param Filter $filter The request filter.
|
||||
*
|
||||
* @return \Model\Collection|null
|
||||
*/
|
||||
|
||||
@@ -222,13 +222,17 @@ class OptionsBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $option
|
||||
* @param $value
|
||||
* @param Definition $definition
|
||||
* Apply an option.
|
||||
*
|
||||
* @param string $option The option name.
|
||||
* @param mixed $value The option value.
|
||||
* @param Definition $definition The definition.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private static function applyOption($option, $value, $definition)
|
||||
{
|
||||
$setter = 'set' . ucfirst($option);
|
||||
$setter = 'set' . ucfirst($option);
|
||||
|
||||
if (method_exists($definition, $setter)) {
|
||||
$definition->$setter($value);
|
||||
|
||||
@@ -30,15 +30,17 @@ class MarkerModel extends AbstractActiveModel
|
||||
protected static $strTable = 'tl_leaflet_marker';
|
||||
|
||||
/**
|
||||
* @param $pid
|
||||
* @param Filter $filter
|
||||
* Find by a filter.
|
||||
*
|
||||
* @param int $pid The parent id.
|
||||
* @param Filter $filter The filter.
|
||||
*
|
||||
* @return \Model\Collection|null
|
||||
*/
|
||||
public static function findByFilter($pid, Filter $filter = null)
|
||||
{
|
||||
if (!$filter) {
|
||||
return MarkerModel::findActiveBy('pid', $pid, array('order' => 'sorting'));
|
||||
return static::findActiveBy('pid', $pid, array('order' => 'sorting'));
|
||||
}
|
||||
|
||||
switch ($filter->getName()) {
|
||||
@@ -51,8 +53,10 @@ class MarkerModel extends AbstractActiveModel
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $pid
|
||||
* @param BboxFilter $filter
|
||||
* Find by the bbox filter.
|
||||
*
|
||||
* @param int $pid The layer id.
|
||||
* @param BboxFilter $filter The bbox filter.
|
||||
*
|
||||
* @return \Model\Collection|null
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user