ExtendableCollector::collect()   A
last analyzed

Complexity

Conditions 4
Paths 3

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 5
cp 0
rs 9.9332
c 0
b 0
f 0
cc 4
nc 3
nop 2
crap 20
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