Completed
Push — master ( 5d9cd9...874e6e )
by mw
62:18 queued 26:13
created

SpyLogger::log()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SMW\Tests\Utils;
4
5
use Psr\Log\AbstractLogger;
6
7
/**
8
 * @group semantic-mediawiki
9
 *
10
 * @license GNU GPL v2+
11
 * @since 2.5
12
 *
13
 * @author mwjames
14
 */
15
class SpyLogger extends AbstractLogger {
16
17
	/**
18
	 * @var array
19
	 */
20
	private $logs = array();
21
22
	/**
23
	 * @since 2.5
24
	 *
25
	 * {@inheritDoc}
26
	 */
27
	public function log( $level, $message, array $context = array() ) {
28
		$this->logs[] = array( $level, $message, $context );
29
	}
30
31
	/**
32
	 * @since 2.5
33
	 *
34
	 * @return array
35
	 */
36
	public function getLogs() {
37
		return $this->logs;
38
	}
39
40
}
41