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

LoadSession   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A handle() 0 4 1
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