| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | public function run($message, $user) |
||
| 10 | { |
||
| 11 | /** @var Game $game */ |
||
| 12 | $game = $this->gameService->findGame($message); |
||
| 13 | |||
| 14 | if ($game->status == 1) { |
||
| 15 | $game->status = 0; |
||
| 16 | |||
| 17 | $this->gameService->em->persist($game); |
||
| 18 | $this->gameService->em->flush(); |
||
| 19 | $this->botApi->sendMessage($message['chat']['id'], 'The game has stopped!'); |
||
| 20 | } else { |
||
| 21 | $this->botApi->sendMessage( |
||
| 22 | $message['chat']['id'], |
||
| 23 | 'The game is not running...Use /start command to run game.' |
||
| 24 | ); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | } |
||
| 28 |