Passed
Push — feature/v4 ( e5e380...dac4aa )
by Samuel
11:37
created

renderPolylineStyle()   B

Complexity

Conditions 7
Paths 8

Size

Total Lines 15
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 7

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 15
ccs 8
cts 8
cp 1
rs 8.8333
cc 7
nc 8
nop 2
crap 7
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Ivory Google Map package.
7
 *
8
 * (c) Eric GELOEN <[email protected]>
9
 *
10
 * For the full copyright and license information, please read the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Ivory\GoogleMap\Helper\Renderer\Image\Overlay;
15
16
use Ivory\GoogleMap\Utility\OptionsAwareInterface;
17
18
abstract class AbstractPolylineStyleRenderer extends AbstractStyleRenderer
19
{
20 10
    public function renderPolylineStyle(array $styles, OptionsAwareInterface $polyline): ?string
21
    {
22 10
        if (!isset($styles['geodesic']) && $polyline->hasOption('geodisc')) {
23 2
            $styles['geodesic'] = $polyline->getOption('geodisc');
24
        }
25
26 10
        if (!isset($styles['color']) && $polyline->hasOption('strokeColor')) {
27 2
            $styles['color'] = $polyline->getOption('strokeColor');
28
        }
29
30 10
        if (!isset($styles['weight']) && $polyline->hasOption('strokeWeight')) {
31 2
            $styles['weight'] = $polyline->getOption('strokeWeight');
32
        }
33
34 10
        return $this->renderStyle($styles);
35
    }
36
}
37