Passed
Push — develop ( c6dbeb...6fc924 )
by Septianata
02:55
created

CoegController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Conversations\ExampleConversation;
6
use BotMan\BotMan\BotMan;
7
use BotMan\BotMan\Facades\BotMan as BotManFacade;
8
9
class CoegController extends Controller
10
{
11
    /**
12
     * The BotMan instance.
13
     *
14
     * @var \BotMan\BotMan\BotMan
15
     */
16
    protected BotMan $botman;
17
18
    /**
19
     * Create a new instance class.
20
     *
21
     * @return void
22
     */
23
    public function __construct()
24
    {
25
        $this->botman = BotManFacade::getFacadeRoot();
26
    }
27
28
    /**
29
     * Place for BotMan logic.
30
     *
31
     * @return void
32
     */
33
    public function handle()
34
    {
35
        $this->botman->listen();
36
    }
37
38
    /**
39
     * Handle start conversation.
40
     *
41
     * @return void
42
     */
43
    public function startConversation()
44
    {
45
        $this->botman->startConversation(new ExampleConversation);
46
    }
47
}
48