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.

MarkerStyleRenderer   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
C render() 0 22 9
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\Renderer\Image\Overlay;
13
14
use Ivory\GoogleMap\Base\Point;
15
use Ivory\GoogleMap\Helper\Renderer\Image\Base\PointRenderer;
16
use Ivory\GoogleMap\Overlay\Icon;
17
use Ivory\GoogleMap\Overlay\Marker;
18
19
/**
20
 * @author GeLo <[email protected]>
21
 */
22
class MarkerStyleRenderer extends AbstractStyleRenderer
23
{
24
    /**
25
     * @var PointRenderer
26
     */
27
    private $pointRenderer;
28
29
    /**
30
     * @param PointRenderer $pointRenderer
31
     */
32 128
    public function __construct(PointRenderer $pointRenderer)
33
    {
34 128
        $this->pointRenderer = $pointRenderer;
35 128
    }
36
37
    /**
38
     * @param Marker $marker
39
     *
40
     * @return string
41
     */
42 40
    public function render(Marker $marker)
43
    {
44 40
        $options = $marker->hasStaticOption('styles') ? $marker->getStaticOption('styles') : [];
45
46 40
        if ($marker->hasIcon()) {
47 8
            $icon = $marker->getIcon();
48
49 8
            if (!isset($options['icon']) && ($url = $icon->getUrl()) !== Icon::DEFAULT_URL) {
50 8
                $options['icon'] = $url;
51 4
            }
52
53 8
            if (!isset($options['anchor']) && $icon->hasAnchor()) {
54 8
                $options['anchor'] = $icon->getAnchor();
55 4
            }
56 4
        }
57
58 40
        if (isset($options['anchor']) && $options['anchor'] instanceof Point) {
59 8
            $options['anchor'] = $this->pointRenderer->render($options['anchor']);
60 4
        }
61
62 40
        return $this->renderStyle($options);
63
    }
64
}
65