NextAction   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 1
cbo 5
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 15 2
1
<?php
2
3
namespace Chrl\AppBundle\GameAction;
4
5
class NextAction extends BaseGameAction implements GameActionInterface
6
{
7
    public function run($message, $user)
8
    {
9
        $game = $this->gameService->findGame($message);
10
11
        if ($game->status == 1) {
12
            $this->botApi->sendMessage(
13
                $game->chatId,
14
                'Ok, changing question.',
15
                'markdown'
16
            );
17
            $this->gameService->em->persist($game);
18
            $this->gameService->em->flush();
19
            $this->gameService->askQuestion($game);
20
        }
21
    }
22
}
23