Intent   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 5
dl 0
loc 28
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Conversation;
6
7
use FondBot\Contracts\Conversable;
8
use FondBot\Events\MessageReceived;
9
use FondBot\Conversation\Concerns\Authorization;
10
use FondBot\Conversation\Concerns\SendsMessages;
11
use FondBot\Conversation\Concerns\InteractsWithContext;
12
13
abstract class Intent implements Conversable
14
{
15
    use InteractsWithContext;
16
    use SendsMessages;
17
    use Authorization;
18
19
    /**
20
     * Intent activators.
21
     *
22
     * @return \FondBot\Contracts\Activator[]
23
     */
24
    abstract public function activators(): array;
25
26
    /**
27
     * Run intent.
28
     *
29
     * @param MessageReceived $message
30
     */
31
    abstract public function run(MessageReceived $message): void;
32
33
    /**
34
     * Handle intent.
35
     *
36
     * @param MessageReceived $message
37
     */
38 1
    public function handle(MessageReceived $message): void
39
    {
40 1
        $this->run($message);
41 1
    }
42
}
43