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

FallbackIntent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A activators() 0 4 1
A run() 0 10 1
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