SpyLogger   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A log() 0 3 1
A getLogs() 0 3 1
1
<?php
2
3
namespace Onoi\CallbackContainer\Tests;
4
5
use Psr\Log\AbstractLogger;
6
7
/**
8
 * @group onoi-callback-container
9
 *
10
 * @license GNU GPL v2+
11
 * @since 2.0
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.0
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.0
33
	 *
34
	 * @return array
35
	 */
36
	public function getLogs() {
37
		return $this->logs;
38
	}
39
40
}
41