Completed
Push — master ( cd535a...da42ba )
by Vladimir
02:31
created

FallbackIntent::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Conversation\Fallback;
6
7
use FondBot\Conversation\Intent;
8
use FondBot\Contracts\Conversation\Activator;
9
10
class FallbackIntent extends Intent
11
{
12
    /**
13
     * Intent activators.
14
     *
15
     * @return Activator[]
16
     */
17
    public function activators(): array
18
    {
19
        return [];
20
    }
21
22
    public function run(): void
23
    {
24
        $text = collect([
25
            'Sorry, I could not understand you.',
26
            'Oops, I can\'t do that 😔',
27
            'My developer did not teach to do that.',
28
        ])->random();
29
30
        $this->sendMessage($text);
31
    }
32
}
33