Passed
Branch master (5c167b)
by smiley
02:26
created

ConsoleLog   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 14
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A message() 0 2 1
A close() 0 4 1
A __log() 0 2 1
1
<?php
2
/**
3
 * Class ConsoleLog
4
 *
5
 * @filesource   ConsoleLog.php
6
 * @created      04.01.2018
7
 * @package      chillerlan\Logger\Output
8
 * @author       Smiley <[email protected]>
9
 * @copyright    2018 Smiley
10
 * @license      MIT
11
 */
12
13
namespace chillerlan\Logger\Output;
14
15
/**
16
 */
17
class ConsoleLog extends LogOutputAbstract{
18
19
	protected function __log(string $level, string $message, array $context = null){
20
		echo $this->message($level, $message, $context);
21
	}
22
23
	public function close():LogOutputInterface{
24
		echo  $this->message('log closed', '~~~');
25
26
		return $this;
27
	}
28
29
	protected function message(string $level, string $message, array $context = null){
0 ignored issues
show
Unused Code introduced by
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

29
	protected function message(string $level, string $message, /** @scrutinizer ignore-unused */ array $context = null){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
30
		return sprintf($this->options->consoleFormat, date($this->options->consoleDateFormat), $level, $message).PHP_EOL;
31
	}
32
}
33