FallbackIntent::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 9
c 0
b 0
f 0
ccs 5
cts 5
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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