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

LogEvent   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 16
c 1
b 0
f 0
dl 0
loc 76
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getChannel() 0 3 1
A getContext() 0 3 1
A getTime() 0 3 1
A getLevel() 0 3 1
A getMessage() 0 3 1
A __construct() 0 12 1
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