LogRecord::getMessage()   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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
/**
4
 * This file is part of the miBadger package.
5
 *
6
 * @author Michael Webbers <[email protected]>
7
 * @license http://opensource.org/licenses/Apache-2.0 Apache v2 License
8
 */
9
10
namespace miBadger\Log;
11
12
/**
13
 * The log record class.
14
 *
15
 * @see http://tools.ietf.org/html/rfc5424
16
 * @since 1.0.0
17
 */
18
class LogRecord
19
{
20
	/** @var string The log records level. */
21
	private $level;
22
23
	/** @var string The log record message. */
24
	private $message;
25
26
	/** @var mixed[] The log record context. */
27
	private $context;
28
29
	/**
30
	 * Construct a log record object with the given level, message & context.
31
	 *
32
	 * @param string $level
33
	 * @param string $message
34
	 * @param mixed[] $context = []
35
	 */
36 13
	public function __construct($level, $message, array $context = [])
37
	{
38 13
		$this->level = $level;
39 13
		$this->message = $message;
40 13
		$this->context = $context;
41 13
	}
42
43
	/**
44
	 * Returns the level.
45
	 *
46
	 * @return string the level.
47
	 */
48 11
	public function getLevel()
49
	{
50 11
		return $this->level;
51
	}
52
53
	/**
54
	 * Returns the message.
55
	 *
56
	 * @return string the message.
57
	 */
58 11
	public function getMessage()
59
	{
60 11
		return $this->message;
61
	}
62
63
	/**
64
	 * Returns the context.
65
	 *
66
	 * @return mixed[] the context.
67
	 */
68 1
	public function getContext()
69
	{
70 1
		return $this->context;
71
	}
72
}
73