| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function run($message, $user) |
||
| 17 | { |
||
| 18 | /** @var Game $game */ |
||
| 19 | $game = $this->gameService->findGame($message); |
||
| 20 | |||
| 21 | if ($game->status == 0) { |
||
| 22 | $game->status = 1; |
||
| 23 | $this->gameService->em->persist($game); |
||
| 24 | $this->gameService->em->flush(); |
||
| 25 | $this->botApi->sendMessage($message['chat']['id'], 'The game has started!'); |
||
| 26 | } else { |
||
| 27 | $this->botApi->sendMessage($message['chat']['id'], 'The game is already running...'); |
||
| 28 | $question = $this->gameService->getRandomQuestion(); |
||
|
|
|||
| 29 | } |
||
| 30 | } |
||
| 31 | } |
||
| 32 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.