Completed
Push — master ( 16b7cb...b112db )
by Vladimir
07:44
created

LoadSession::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Foundation\Commands;
6
7
use FondBot\Channels\Chat;
8
use FondBot\Channels\User;
9
use FondBot\Channels\Channel;
10
use FondBot\Conversation\Session;
11
use FondBot\Conversation\SessionManager;
12
13
class LoadSession
14
{
15
    private $channel;
16
    private $chat;
17
    private $user;
18
19
    public function __construct(Channel $channel, Chat $chat, User $user)
20
    {
21
        $this->channel = $channel;
22
        $this->chat = $chat;
23
        $this->user = $user;
24
    }
25
26
    public function handle(SessionManager $manager): Session
27
    {
28
        return $manager->load($this->channel, $this->chat, $this->user);
29
    }
30
}
31