Passed
Push — master ( 236a58...055c31 )
by Vladimir
07:58
created

InteractsWithSession   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getChat() 0 4 1
A getUser() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Conversation\Traits;
6
7
use FondBot\Drivers\Chat;
8
use FondBot\Drivers\User;
9
use FondBot\Foundation\Kernel;
10
11
trait InteractsWithSession
12
{
13
    /** @var Kernel */
14
    protected $kernel;
15
16
    /**
17
     * Get chat.
18
     *
19
     * @return Chat
20
     */
21 1
    protected function getChat(): Chat
22
    {
23 1
        return $this->kernel->getSession()->getChat();
24
    }
25
26
    /**
27
     * Get user.
28
     *
29
     * @return User
30
     */
31 2
    protected function getUser(): User
32
    {
33 2
        return $this->kernel->getSession()->getUser();
34
    }
35
}
36