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.

ApiInitRenderer   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
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 47
ccs 21
cts 21
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B render() 0 33 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;
13
14
/**
15
 * @author GeLo <[email protected]>
16
 */
17
class ApiInitRenderer extends AbstractRenderer
18
{
19
    /**
20
     * @param string            $name
21
     * @param \SplObjectStorage $callbacks
22
     * @param \SplObjectStorage $requirements
23
     * @param string[]          $sources
24
     * @param string            $sourceCallback
25
     * @param string            $requirementCallback
26
     * @param bool              $newLine
27
     *
28
     * @return string
29
     */
30 276
    public function render(
31
        $name,
32
        \SplObjectStorage $callbacks,
33
        \SplObjectStorage $requirements,
34
        array $sources,
35
        $sourceCallback,
36
        $requirementCallback,
37
        $newLine = true
38
    ) {
39 276
        $formatter = $this->getFormatter();
40 276
        $separator = $formatter->renderSeparator();
41 276
        $codes = [];
42
43 276
        foreach ($sources as $source) {
44 52
            $codes[] = $formatter->renderCall($sourceCallback, [$formatter->renderEscape($source)], true);
45 138
        }
46
47 276
        foreach ($callbacks as $object) {
48 276
            $codes[] = $formatter->renderCall($requirementCallback, [
49 276
                $callbacks[$object],
50 276
                $formatter->renderClosure($formatter->renderCode(
51 276
                    'return '.implode(
52 276
                        $separator.'&&'.$separator,
53 276
                        isset($requirements[$object]) ? $requirements[$object] : []
54 138
                    ),
55 276
                    true,
56 138
                    false
57 138
                )),
58 276
            ], true);
59 138
        }
60
61 276
        return $formatter->renderClosure($formatter->renderLines($codes, true, false), [], $name, true, $newLine);
62
    }
63
}
64