Passed
Push — master ( 98541d...d359a0 )
by
unknown
08:18
created

Transitions   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 29
c 0
b 0
f 0
ccs 0
cts 7
cp 0
rs 10
wmc 3
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A jump() 0 11 2
A restart() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Conversation\Traits;
6
7
use InvalidArgumentException;
8
use Illuminate\Container\Container;
9
use FondBot\Conversation\Interaction;
10
11
trait Transitions
12
{
13
    /**
14
     * Jump to another interaction.
15
     *
16
     * @param string $interaction
17
     *
18
     * @throws \InvalidArgumentException
19
     */
20
    protected function jump(string $interaction): void
21
    {
22
        /** @var Interaction $instance */
23
        $instance = Container::getInstance()->make($interaction);
24
25
        if (!$instance instanceof Interaction) {
26
            throw new InvalidArgumentException('Invalid interaction `'.$interaction.'`');
27
        }
28
29
        // TODO
30
    }
31
32
    /**
33
     * Restart current intent or interaction.
34
     */
35
    protected function restart(): void
36
    {
37
        // TODO
38
    }
39
}
40