| Conditions | 5 |
| Paths | 16 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | 4 | private function process(string $command): void |
|
| 41 | { |
||
| 42 | 4 | if ('f' === $command) { |
|
| 43 | 1 | $this->coordinates = new Coordinates( |
|
| 44 | 1 | $this->coordinates->coordinateX(), |
|
| 45 | 1 | $this->coordinates->coordinateY() + 1 |
|
| 46 | ); |
||
| 47 | } |
||
| 48 | 4 | if ('b' === $command) { |
|
| 49 | 1 | $this->coordinates = new Coordinates( |
|
| 50 | 1 | $this->coordinates->coordinateX(), |
|
| 51 | 1 | $this->coordinates->coordinateY() - 1 |
|
| 52 | ); |
||
| 53 | } |
||
| 54 | 4 | if ('r' === $command) { |
|
| 55 | 1 | $this->direction = $this->direction->turnRight(); |
|
| 56 | } |
||
| 57 | 4 | if ('l' === $command) { |
|
| 58 | 1 | $this->direction = $this->direction->turnLeft(); |
|
| 59 | } |
||
| 60 | 4 | } |
|
| 61 | } |
||
| 62 |