FallbackIntent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 21
c 0
b 0
f 0
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A activators() 0 3 1
A run() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Conversation;
6
7
use FondBot\Contracts\Activator;
8
use FondBot\Events\MessageReceived;
9
10
class FallbackIntent extends Intent
11
{
12
    /**
13
     * Intent activators.
14
     *
15
     * @return Activator[]
16
     */
17 1
    public function activators(): array
18
    {
19 1
        return [];
20
    }
21
22 1
    public function run(MessageReceived $message): void
23
    {
24 1
        $text = collect([
25 1
            'Sorry, I could not understand you.',
26
            'Oops, I can\'t do that 😔',
27
            'My developer did not teach to do that.',
28 1
        ])->random();
29
30 1
        $this->reply($text);
31 1
    }
32
}
33