Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
43 | 8 | public function resolveCommand(array $configuration = null) |
|
44 | { |
||
45 | 8 | $message = $this->payload->getData()['text']; |
|
46 | 8 | $commandClass = $this->detectCommandClass($message); |
|
47 | 8 | if (class_exists($commandClass)) { |
|
48 | 6 | return new $commandClass($this->payload, $this->client, $configuration); |
|
49 | } |
||
50 | |||
51 | 2 | if (strpos($message, 'botty') !== false || strpos($message, $configuration['slack']['botId']) !== false) { |
|
52 | 1 | return new BottyCommand($this->payload, $this->client, $configuration); |
|
53 | } |
||
54 | |||
55 | 1 | return false; |
|
56 | } |
||
57 | |||
70 |