GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — static-map ( 1bc0cf )
by Eric
64:02
created

MarkerCollector::collect()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 6
nc 2
nop 2
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\Helper\Renderer\Image\Overlay\MarkerStyleRenderer;
16
use Ivory\GoogleMap\Map;
17
use Ivory\GoogleMap\Overlay\Marker;
18
19
/**
20
 * @author GeLo <[email protected]>
21
 */
22
class MarkerCollector extends AbstractCollector
23
{
24
    /**
25
     * @var MarkerStyleRenderer
26
     */
27
    private $markerStyleRenderer;
28
29
    /**
30
     * @param MarkerStyleRenderer $markerStyleRenderer
31
     */
32
    public function __construct(MarkerStyleRenderer $markerStyleRenderer)
33
    {
34
        $this->markerStyleRenderer = $markerStyleRenderer;
35
    }
36
37
    /**
38
     * @param Map      $map
39
     * @param Marker[] $markers
40
     *
41
     * @return Marker[][]
42
     */
43
    public function collect(Map $map, array $markers = [])
44
    {
45
        $result = [];
46
47
        foreach (array_merge($markers, $map->getOverlayManager()->getMarkers()) as $marker) {
48
            $hash = md5($this->markerStyleRenderer->render($marker));
49
            $result[$hash] = $this->collectValue($marker, isset($result[$hash]) ? $result[$hash] : []);
50
        }
51
52
        return array_values($result);
53
    }
54
}
55