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.

Code Duplication    Length = 26-34 lines in 3 locations

src/Helper/Renderer/Layer/HeatmapLayerRenderer.php 1 location

@@ 21-54 (lines=34) @@
18
/**
19
 * @author GeLo <[email protected]>
20
 */
21
class HeatmapLayerRenderer extends AbstractJsonRenderer
22
{
23
    /**
24
     * @param HeatmapLayer $heatmapLayer
25
     * @param Map          $map
26
     *
27
     * @return string
28
     */
29
    public function render(HeatmapLayer $heatmapLayer, Map $map)
30
    {
31
        $formatter = $this->getFormatter();
32
        $jsonBuilder = $this->getJsonBuilder();
33
34
        foreach ($heatmapLayer->getCoordinates() as $index => $coordinate) {
35
            $jsonBuilder->setValue('[data]['.$index.']', $coordinate->getVariable(), false);
36
        }
37
38
        $jsonBuilder
39
            ->setValue('[map]', $map->getVariable(), false)
40
            ->setValues($heatmapLayer->getOptions());
41
42
        return $formatter->renderObjectAssignment($heatmapLayer, $formatter->renderObject('HeatmapLayer', [
43
            $jsonBuilder->build(),
44
        ], $formatter->renderClass('visualization')));
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function renderRequirement()
51
    {
52
        return $this->getFormatter()->renderClass('visualization');
53
    }
54
}
55

src/Helper/Renderer/Overlay/PolygonRenderer.php 1 location

@@ 21-46 (lines=26) @@
18
/**
19
 * @author GeLo <[email protected]>
20
 */
21
class PolygonRenderer extends AbstractJsonRenderer
22
{
23
    /**
24
     * @param Polygon $polygon
25
     * @param Map     $map
26
     *
27
     * @return string
28
     */
29
    public function render(Polygon $polygon, Map $map)
30
    {
31
        $formatter = $this->getFormatter();
32
        $jsonBuilder = $this->getJsonBuilder()
33
            ->setValue('[map]', $map->getVariable(), false)
34
            ->setValue('[paths]', []);
35
36
        foreach ($polygon->getCoordinates() as $index => $coordinate) {
37
            $jsonBuilder->setValue('[paths]['.$index.']', $coordinate->getVariable(), false);
38
        }
39
40
        $jsonBuilder->setValues($polygon->getOptions());
41
42
        return $formatter->renderObjectAssignment($polygon, $formatter->renderObject('Polygon', [
43
            $jsonBuilder->build(),
44
        ]));
45
    }
46
}
47

src/Helper/Renderer/Overlay/PolylineRenderer.php 1 location

@@ 21-46 (lines=26) @@
18
/**
19
 * @author GeLo <[email protected]>
20
 */
21
class PolylineRenderer extends AbstractJsonRenderer
22
{
23
    /**
24
     * @param Polyline $polyline
25
     * @param Map      $map
26
     *
27
     * @return string
28
     */
29
    public function render(Polyline $polyline, Map $map)
30
    {
31
        $formatter = $this->getFormatter();
32
        $jsonBuilder = $this->getJsonBuilder()
33
            ->setValue('[map]', $map->getVariable(), false)
34
            ->setValue('[path]', []);
35
36
        foreach ($polyline->getCoordinates() as $index => $coordinate) {
37
            $jsonBuilder->setValue('[path]['.$index.']', $coordinate->getVariable(), false);
38
        }
39
40
        $jsonBuilder->setValues($polyline->getOptions());
41
42
        return $formatter->renderObjectAssignment($polyline, $formatter->renderObject('Polyline', [
43
            $jsonBuilder->build(),
44
        ]));
45
    }
46
}
47