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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 4
dl 0
loc 33
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A collect() 0 11 3
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