Record::getLevel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Yep\WorkflowLogger;
4
5
/**
6
 * Class Record
7
 *
8
 * @package Yep\WorkflowLogger
9
 * @author  Martin Zeman (Zemistr) <[email protected]>
10
 */
11
class Record
12
{
13
    /**
14
     * @var array
15
     */
16
    protected $context;
17
18
    /**
19
     * @var \DateTime
20
     */
21
    protected $datetime;
22
23
    /**
24
     * @var string
25
     */
26
    protected $level;
27
28
    /**
29
     * @var string
30
     */
31
    protected $message;
32
33
    /**
34
     * Record constructor.
35
     *
36
     * @param \DateTime $datetime
37
     * @param string    $message
38
     * @param string    $level
39
     * @param array     $context
40
     */
41 5
    public function __construct(
42
      \DateTime $datetime,
43
      $message,
44
      $level,
45
      array $context
46
    ) {
47 5
        $this->datetime = $datetime;
48 5
        $this->message = (string)$message;
49 5
        $this->level = (string)$level;
50 5
        $this->context = $context;
51 5
    }
52
53
    /**
54
     * @return \DateTime
55
     */
56 4
    public function getDatetime()
57
    {
58 4
        return $this->datetime;
59
    }
60
61
    /**
62
     * @return string
63
     */
64 4
    public function getMessage()
65
    {
66 4
        return $this->message;
67
    }
68
69
    /**
70
     * @return string
71
     */
72 4
    public function getLevel()
73
    {
74 4
        return $this->level;
75
    }
76
77
    /**
78
     * @return array
79
     */
80 4
    public function getContext()
81
    {
82 4
        return $this->context;
83
    }
84
}
85