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 — master ( 89c9d5...c16126 )
by Eric
109:24 queued 106:15
created

StyleRenderer::render()   A

Complexity

Conditions 4
Paths 8

Size

Total Lines 18
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 12
cts 12
cp 1
rs 9.2
c 0
b 0
f 0
cc 4
eloc 9
nc 8
nop 1
crap 4
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;
13
14
/**
15
 * @author GeLo <[email protected]>
16
 */
17
class StyleRenderer
18
{
19
    /**
20
     * @param mixed[] $style
21
     *
22
     * @return string
23
     */
24 20
    public function render(array $style)
25
    {
26 20
        $result = [];
27
28 20
        if (isset($style['feature'])) {
29 8
            $result[] = $this->renderStyle('feature', $style['feature']);
30 4
        }
31
32 20
        if (isset($style['element'])) {
33 8
            $result[] = $this->renderStyle('element', $style['element']);
34 4
        }
35
36 20
        foreach ($style['rules'] as $rule => $value) {
37 20
            $result[] = $this->renderStyle($rule, $value);
38 10
        }
39
40 20
        return implode('|', $result);
41
    }
42
43
    /**
44
     * @param string $name
45
     * @param string $value
46
     *
47
     * @return string
48
     */
49 20
    private function renderStyle($name, $value)
50
    {
51 20
        return $name.':'.$value;
52
    }
53
}
54