Passed
Push — develop ( 209048...cb8559 )
by Septianata
02:54
created

BotmanController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Conversations\ExampleConversation;
6
use BotMan\BotMan\BotMan;
7
8
class BotmanController extends Controller
9
{
10
    /**
11
     * Create a new instance class.
12
     *
13
     * @return void
14
     */
15
    public function __construct(
16
        protected BotMan $botman
17
    ) {
18
        $this->botman = $botman;
19
    }
20
21
    /**
22
     * Handle start conversation.
23
     *
24
     * @return void
25
     */
26
    public function startConversation()
27
    {
28
        $this->botman->startConversation(new ExampleConversation);
29
    }
30
}
31