Passed
Push — master ( d47bdf...6296de )
by Kirill
03:33
created

LogEvent::getChannel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Logger\Event;
13
14
final class LogEvent
15
{
16
    /** @var \DateTimeInterface */
17
    private $time;
18
19
    /** @var string */
20
    private $channel;
21
22
    /** @var string */
23
    private $level;
24
25
    /** @var string */
26
    private $message;
27
28
    /** @var array */
29
    private $context;
30
31
    /**
32
     * @param \DateTimeInterface $time
33
     * @param string             $channel
34
     * @param string             $level
35
     * @param string             $message
36
     * @param array              $context
37
     */
38
    public function __construct(
39
        \DateTimeInterface $time,
40
        string $channel,
41
        string $level,
42
        string $message,
43
        array $context = []
44
    ) {
45
        $this->time = $time;
46
        $this->channel = $channel;
47
        $this->level = $level;
48
        $this->message = $message;
49
        $this->context = $context;
50
    }
51
52
    /**
53
     * @return \DateTimeInterface
54
     */
55
    public function getTime(): \DateTimeInterface
56
    {
57
        return $this->time;
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function getChannel(): string
64
    {
65
        return $this->channel;
66
    }
67
68
    /**
69
     * @return string
70
     */
71
    public function getLevel(): string
72
    {
73
        return $this->level;
74
    }
75
76
    /**
77
     * @return string
78
     */
79
    public function getMessage(): string
80
    {
81
        return $this->message;
82
    }
83
84
    /**
85
     * @return array
86
     */
87
    public function getContext(): array
88
    {
89
        return $this->context;
90
    }
91
}
92