Code style.

This commit is contained in:
David Molineus
2015-01-27 17:58:03 +01:00
parent fdd3b443f3
commit 3abe5c6517
6 changed files with 26 additions and 15 deletions

View File

@@ -84,9 +84,10 @@ class Marker
$values = trimsplit(',', $value); $values = trimsplit(',', $value);
$keys = array_keys($combined); $keys = array_keys($combined);
$count = count($values);
if (count($values) >= 2 && count($values) <= 3) { if ($count >= 2 && $count <= 3) {
for ($i = 0; $i < count($values); $i++) { for ($i = 0; $i < $count; $i++) {
$combined[$keys[$i]] = $values[$i]; $combined[$keys[$i]] = $values[$i];
} }
} }
@@ -106,6 +107,8 @@ class Marker
* @param \DataContainer $dataContainer The data container driver. * @param \DataContainer $dataContainer The data container driver.
* *
* @return string * @return string
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/ */
public function loadCoordinates($value, $dataContainer) public function loadCoordinates($value, $dataContainer)
{ {

View File

@@ -30,7 +30,7 @@ class BboxFilter implements Filter
/** /**
* Construct. * Construct.
* *
* @param \Netzmacht\LeafletPHP\Value\LatLngBounds $bounds The bounds. * @param LatLngBounds $bounds The bounds.
*/ */
public function __construct(LatLngBounds $bounds) public function __construct(LatLngBounds $bounds)
{ {

View File

@@ -109,7 +109,7 @@ class MapService
* Get map javascript. * Get map javascript.
* *
* @param MapModel|int $mapId The map database id. MapModel accepted as well. * @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 $elementId Optional element id. If none given the mapId or alias is used.
* @param string $template The template being used for generating. * @param string $template The template being used for generating.
* @param string $style Optional style attributes. * @param string $style Optional style attributes.

View File

@@ -144,8 +144,8 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
/** /**
* Load all layer markers. * Load all layer markers.
* *
* @param \Model $model The layer model. * @param \Model $model The layer model.
* @param Filter $filter null The request filter. * @param Filter $filter The request filter.
* *
* @return \Model\Collection|null * @return \Model\Collection|null
*/ */

View File

@@ -222,13 +222,17 @@ class OptionsBuilder
} }
/** /**
* @param $option * Apply an option.
* @param $value *
* @param Definition $definition * @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) private static function applyOption($option, $value, $definition)
{ {
$setter = 'set' . ucfirst($option); $setter = 'set' . ucfirst($option);
if (method_exists($definition, $setter)) { if (method_exists($definition, $setter)) {
$definition->$setter($value); $definition->$setter($value);

View File

@@ -30,15 +30,17 @@ class MarkerModel extends AbstractActiveModel
protected static $strTable = 'tl_leaflet_marker'; protected static $strTable = 'tl_leaflet_marker';
/** /**
* @param $pid * Find by a filter.
* @param Filter $filter *
* @param int $pid The parent id.
* @param Filter $filter The filter.
* *
* @return \Model\Collection|null * @return \Model\Collection|null
*/ */
public static function findByFilter($pid, Filter $filter = null) public static function findByFilter($pid, Filter $filter = null)
{ {
if (!$filter) { if (!$filter) {
return MarkerModel::findActiveBy('pid', $pid, array('order' => 'sorting')); return static::findActiveBy('pid', $pid, array('order' => 'sorting'));
} }
switch ($filter->getName()) { switch ($filter->getName()) {
@@ -51,8 +53,10 @@ class MarkerModel extends AbstractActiveModel
} }
/** /**
* @param $pid * Find by the bbox filter.
* @param BboxFilter $filter *
* @param int $pid The layer id.
* @param BboxFilter $filter The bbox filter.
* *
* @return \Model\Collection|null * @return \Model\Collection|null
*/ */