ExtendableCollector   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 3
dl 0
loc 18
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A collect() 0 10 4
1
<?php
2
3
/*
4
 * This file is part of the Ivory Google Map package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\GoogleMap\Helper\Collector\Image;
13
14
use Ivory\GoogleMap\Helper\Collector\AbstractCollector;
15
use Ivory\GoogleMap\Map;
16
use Ivory\GoogleMap\Overlay\ExtendableInterface;
17
use Ivory\GoogleMap\Overlay\Marker;
18
use Ivory\GoogleMap\Overlay\Polyline;
19
20
/**
21
 * @author GeLo <[email protected]>
22
 */
23
class ExtendableCollector extends AbstractCollector
24
{
25
    /**
26
     * @param ExtendableInterface[] $extendables
27
     *
28
     * @return ExtendableInterface[]
29
     */
30
    public function collect(Map $map, array $extendables = [])
31
    {
32
        foreach ($map->getBound()->getExtendables() as $extendable) {
33
            if ($extendable instanceof Marker || $extendable instanceof Polyline) {
34
                $extendables = $this->collectValue($extendable, $extendables);
35
            }
36
        }
37
38
        return $extendables;
39
    }
40
}
41