Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 3 | public static function renderLineStringPath(LineString $lineString, Coordinator $coordinator): string |
|
23 | { |
||
24 | 3 | $renderedLineString = ''; |
|
25 | 3 | foreach ($lineString->getPositions() as $key => $position) { |
|
26 | 2 | if ($key === 0) { |
|
27 | 2 | $renderedLineString .= self::MOVE_TO; |
|
28 | } else { |
||
29 | 1 | $renderedLineString .= ' ' . self::LINE_TO; |
|
30 | } |
||
31 | |||
32 | 2 | $renderedLineString .= $coordinator->getX($position) . ' ' . $coordinator->getY($position); |
|
33 | } |
||
34 | |||
35 | 3 | return $renderedLineString; |
|
36 | } |
||
38 |