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   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 37
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 18 4
A renderStyle() 0 4 1
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