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.

ObjectToArrayRenderer   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 34
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B render() 0 24 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\Utility;
13
14
use Ivory\GoogleMap\Helper\Renderer\AbstractRenderer;
15
16
/**
17
 * @author GeLo <[email protected]>
18
 */
19
class ObjectToArrayRenderer extends AbstractRenderer
20
{
21
    /**
22
     * @param string|null $arrayVariable
23
     * @param string|null $objectVariable
24
     * @param string|null $keyVariable
25
     *
26
     * @return string
27
     */
28 228
    public function render($arrayVariable = null, $objectVariable = null, $keyVariable = null)
29
    {
30 228
        $formatter = $this->getFormatter();
31
32 228
        $arrayVariable = $arrayVariable ?: 'a';
33 228
        $objectVariable = $objectVariable ?: 'o';
34 228
        $keyVariable = $keyVariable ?: 'k';
35
36 228
        return $formatter->renderClosure($formatter->renderLines([
37 228
            $formatter->renderAssignment('var '.$arrayVariable, '[]', true),
38 228
            $formatter->renderStatement(
39 228
                'for',
40 228
                $formatter->renderCall(
41 228
                    $formatter->renderProperty($arrayVariable, 'push'),
42 228
                    [$objectVariable.'['.$keyVariable.']'],
43 114
                    true
44 114
                ),
45 228
                'var '.$keyVariable.' in '.$objectVariable,
46 228
                null,
47 114
                false
48 114
            ),
49 228
            $formatter->renderCode('return '.$arrayVariable, true, false),
50 228
        ], true, false), [$objectVariable]);
51
    }
52
}
53