AbstractPolylineStyleRenderer   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 2
dl 0
loc 24
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B renderPolylineStyle() 0 16 7
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\Utility\OptionsAwareInterface;
15
16
/**
17
 * @author GeLo <[email protected]>
18
 */
19
abstract class AbstractPolylineStyleRenderer extends AbstractStyleRenderer
20
{
21
    /**
22
     * @param mixed[] $styles
23
     *
24
     * @return string
25
     */
26 40
    public function renderPolylineStyle(array $styles, OptionsAwareInterface $polyline)
27
    {
28 40
        if (!isset($styles['geodesic']) && $polyline->hasOption('geodisc')) {
29 8
            $styles['geodesic'] = $polyline->getOption('geodisc');
30
        }
31
32 40
        if (!isset($styles['color']) && $polyline->hasOption('strokeColor')) {
33 8
            $styles['color'] = $polyline->getOption('strokeColor');
34
        }
35
36 40
        if (!isset($styles['weight']) && $polyline->hasOption('strokeWeight')) {
37 8
            $styles['weight'] = $polyline->getOption('strokeWeight');
38
        }
39
40 40
        return $this->renderStyle($styles);
41
    }
42
}
43