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