Completed
Push — master ( 17cc82...f31b80 )
by Vladimir
02:38
created

Intent::passesAuthorization()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Conversation;
6
7
use FondBot\Bot;
8
use FondBot\Conversation\Traits\Transitions;
9
use FondBot\Conversation\Traits\Authorization;
10
use FondBot\Conversation\Traits\HasActivators;
11
use FondBot\Conversation\Traits\SendsMessages;
12
use FondBot\Conversation\Traits\InteractsWithContext;
13
14
abstract class Intent implements Conversable
15
{
16
    use InteractsWithContext,
17
        SendsMessages,
18
        Authorization,
19
        HasActivators,
20
        Transitions;
21
22
    /**
23
     * Run intent.
24
     */
25
    abstract public function run(): void;
26
27
    /**
28
     * Handle intent.
29
     *
30
     * @param Bot $bot
31
     */
32 1
    public function handle(Bot $bot): void
33
    {
34 1
        $this->bot = $bot;
35 1
        $this->run();
36 1
    }
37
}
38