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 — static-map ( 1bc0cf )
by Eric
64:02
created

PolylineLocationRenderer::render()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 8
nc 2
nop 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\Overlay;
13
14
use Ivory\GoogleMap\Base\Coordinate;
15
use Ivory\GoogleMap\Helper\Renderer\Image\Base\CoordinateRenderer;
16
use Ivory\GoogleMap\Overlay\Polyline;
17
18
/**
19
 * @author GeLo <[email protected]>
20
 */
21
class PolylineLocationRenderer
22
{
23
    /**
24
     * @var CoordinateRenderer
25
     */
26
    private $coordinateRenderer;
27
28
    /**
29
     * @param CoordinateRenderer $coordinateRenderer
30
     */
31
    public function __construct(CoordinateRenderer $coordinateRenderer)
32
    {
33
        $this->coordinateRenderer = $coordinateRenderer;
34
    }
35
36
    /**
37
     * @param Polyline $polyline
38
     *
39
     * @return string
40
     */
41
    public function render(Polyline $polyline)
42
    {
43
        if ($polyline->hasStaticOption('locations')) {
44
            $locations = $polyline->getStaticOption('locations');
45
        } else {
46
            $locations = $polyline->getCoordinates();
47
        }
48
49
        return implode('|', array_map(function ($location) {
50
            return $location instanceof Coordinate ? $this->coordinateRenderer->render($location) : $location;
51
        }, $locations));
52
    }
53
}
54