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.

IconRenderer::render()   B
last analyzed

Complexity

Conditions 5
Paths 16

Size

Total Lines 23
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 16
CRAP Score 5

Importance

Changes 0
Metric Value
dl 0
loc 23
ccs 16
cts 16
cp 1
rs 8.5906
c 0
b 0
f 0
cc 5
eloc 12
nc 16
nop 1
crap 5
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\Overlay;
13
14
use Ivory\GoogleMap\Helper\Renderer\AbstractJsonRenderer;
15
use Ivory\GoogleMap\Overlay\Icon;
16
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class IconRenderer extends AbstractJsonRenderer
21
{
22
    /**
23
     * @param Icon $icon
24
     *
25
     * @return string
26
     */
27 16
    public function render(Icon $icon)
28
    {
29 16
        $jsonBuilder = $this->getJsonBuilder()
30 16
            ->setValue('[url]', $icon->getUrl());
31
32 16
        if ($icon->hasAnchor()) {
33 4
            $jsonBuilder->setValue('[anchor]', $icon->getAnchor()->getVariable(), false);
34 2
        }
35
36 16
        if ($icon->hasOrigin()) {
37 4
            $jsonBuilder->setValue('[origin]', $icon->getOrigin()->getVariable(), false);
38 2
        }
39
40 16
        if ($icon->hasScaledSize()) {
41 4
            $jsonBuilder->setValue('[scaledSize]', $icon->getScaledSize()->getVariable(), false);
42 2
        }
43
44 16
        if ($icon->hasSize()) {
45 4
            $jsonBuilder->setValue('[size]', $icon->getScaledSize()->getVariable(), false);
46 2
        }
47
48 16
        return $this->getFormatter()->renderObjectAssignment($icon, $jsonBuilder->build());
49
    }
50
}
51