Completed
Push — master ( 3147c9...abfbd6 )
by Vladimir
03:05
created

Kernel::setContext()   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
dl 0
loc 4
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Foundation;
6
7
use FondBot\Channels\Channel;
8
use Illuminate\Contracts\Container\Container;
9
10
class Kernel
11
{
12
    public const VERSION = '2.0';
13
14
    private $container;
15
16
    /** @var Channel|null */
17
    private $channel;
18
19
    public function __construct(Container $container)
20
    {
21
        $this->container = $container;
22
    }
23
24
    /**
25
     * Initialize kernel.
26
     *
27
     * @param Channel $channel
28
     */
29
    public function initialize(Channel $channel): void
30
    {
31
        $this->channel = $channel;
32
    }
33
34
    /**
35
     * Get current channel.
36
     *
37
     * @return Channel|null
38
     */
39
    public function getChannel(): ?Channel
40
    {
41
        return $this->channel;
42
    }
43
}
44