Completed
Push — master ( ea2a4b...ce5c76 )
by Jeroen De
02:55 queued 47s
created

LogCall   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 33
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getLevel() 0 3 1
A getMessage() 0 3 1
A getContext() 0 3 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\PsrLogTestDoubles;
6
7
/**
8
 * Value object representing a call to the logger
9
 *
10
 * @licence GNU GPL v2+
11
 * @author Jeroen De Dauw < [email protected] >
12
 */
13
class LogCall {
14
15
	private $level;
16
	private $message;
17
	private $context;
18
19
	/**
20
	 * @param mixed $level Typically one of the @see LogLevel constants
21
	 * @param string $message
22
	 * @param array $context
23
	 */
24 4
	public function __construct( $level, string $message, array $context = [] ) {
25 4
		$this->level = $level;
26 4
		$this->message = $message;
27 4
		$this->context = $context;
28 4
	}
29
30
	/**
31
	 * @return mixed Typically one of the @see LogLevel constants
32
	 */
33 1
	public function getLevel() {
34 1
		return $this->level;
35
	}
36
37 2
	public function getMessage(): string {
38 2
		return $this->message;
39
	}
40
41 1
	public function getContext(): array {
42 1
		return $this->context;
43
	}
44
45
}
46