| Conditions | 5 |
| Paths | 4 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5.025 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | 8 | public function resolveCommand(array $configuration = null) |
|
| 44 | { |
||
| 45 | 8 | $message = $this->payload->getData()['text'] ?? ''; |
|
| 46 | 8 | if ($message === '') { |
|
| 47 | return false; |
||
| 48 | } |
||
| 49 | 8 | $commandClass = $this->detectCommandClass($message); |
|
| 50 | 8 | if (class_exists($commandClass)) { |
|
| 51 | 6 | return new $commandClass($this->payload, $this->client, $configuration); |
|
| 52 | } |
||
| 53 | |||
| 54 | 2 | if (strpos($message, 'botty') !== false || strpos($message, $configuration['slack']['botId']) !== false) { |
|
| 55 | 1 | return new BottyCommand($this->payload, $this->client, $configuration); |
|
| 56 | } |
||
| 57 | |||
| 58 | 1 | return false; |
|
| 59 | } |
||
| 60 | |||
| 73 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.