| @@ 46-55 (lines=10) @@ | ||
| 43 | * |
|
| 44 | * @param TurnLeft $command |
|
| 45 | */ |
|
| 46 | public function handleTurningLeft(TurnLeft $command): void |
|
| 47 | { |
|
| 48 | $robot = $this->getRobot(); |
|
| 49 | ||
| 50 | $robot->left(); |
|
| 51 | ||
| 52 | $this->repository->save($robot); |
|
| 53 | ||
| 54 | $this->logger->info('Robot turned left'); |
|
| 55 | } |
|
| 56 | ||
| 57 | /** |
|
| 58 | * @Subscribe |
|
| @@ 78-87 (lines=10) @@ | ||
| 75 | * |
|
| 76 | * @param MoveForward $command |
|
| 77 | */ |
|
| 78 | public function handleMoveForward(MoveForward $command): void |
|
| 79 | { |
|
| 80 | $robot = $this->getRobot(); |
|
| 81 | ||
| 82 | $robot->move(); |
|
| 83 | ||
| 84 | $this->repository->save($robot); |
|
| 85 | ||
| 86 | $this->logger->info('Robot moved forward'); |
|
| 87 | } |
|
| 88 | ||
| 89 | /** |
|
| 90 | * @return Robot |
|