| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | 4 | public function printSequence(): void |
|
| 16 | { |
||
| 17 | 4 | $coordinatesAsString = []; |
|
| 18 | |||
| 19 | 4 | foreach ($this->sequence as $coordinate) { |
|
| 20 | 3 | $coordinatesAsString[] = $this->getCoordinateAsString($coordinate); |
|
| 21 | } |
||
| 22 | |||
| 23 | 4 | $cost = $this->getTotalDistance(); |
|
| 24 | |||
| 25 | 3 | if (!empty($coordinatesAsString)) { |
|
| 26 | 2 | echo implode(' => ', $coordinatesAsString); |
|
| 27 | 2 | echo "\n"; |
|
| 28 | } |
||
| 29 | |||
| 30 | 3 | echo "Total cost: $cost"; |
|
| 31 | 3 | } |
|
| 65 |