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 — custom-control ( 2eba71 )
by Eric
02:57
created

CustomControlRenderer   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 1
cbo 4
dl 0
loc 54
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getControlPositionRenderer() 0 4 1
A setControlPositionRenderer() 0 4 1
A render() 0 13 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\Control;
13
14
use Ivory\GoogleMap\Control\CustomControl;
15
use Ivory\GoogleMap\Helper\Formatter\Formatter;
16
use Ivory\GoogleMap\Helper\Renderer\AbstractRenderer;
17
use Ivory\GoogleMap\Map;
18
19
/**
20
 * @author GeLo <[email protected]>
21
 */
22
class CustomControlRenderer extends AbstractRenderer
23
{
24
    /**
25
     * @var ControlPositionRenderer
26
     */
27
    private $controlPositionRenderer;
28
29
    /**
30
     * @param Formatter               $formatter
31
     * @param ControlPositionRenderer $controlPositionRenderer
32
     */
33
    public function __construct(Formatter $formatter, ControlPositionRenderer $controlPositionRenderer)
34
    {
35
        parent::__construct($formatter);
36
37
        $this->setControlPositionRenderer($controlPositionRenderer);
38
    }
39
40
    /**
41
     * @return ControlPositionRenderer
42
     */
43
    public function getControlPositionRenderer()
44
    {
45
        return $this->controlPositionRenderer;
46
    }
47
48
    /**
49
     * @param ControlPositionRenderer $controlPositionRenderer
50
     */
51
    public function setControlPositionRenderer(ControlPositionRenderer $controlPositionRenderer)
52
    {
53
        $this->controlPositionRenderer = $controlPositionRenderer;
54
    }
55
56
    /**
57
     * @param CustomControl $customControl
58
     * @param Map           $map
59
     *
60
     * @return string
61
     */
62
    public function render(CustomControl $customControl, Map $map)
63
    {
64
        $formatter = $this->getFormatter();
65
66
        return $formatter->renderObjectCall(
67
            $map,
68
            $formatter->renderProperty(
69
                'controls['.$this->controlPositionRenderer->render($customControl->getPosition()).']',
70
                'push'
71
            ),
72
            [$formatter->renderCall('('.$formatter->renderClosure($customControl->getControl()).')')]
73
        );
74
    }
75
}
76