OutputLogger   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 2
eloc 5
c 2
b 1
f 0
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A clear() 0 3 1
A log() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WebServCo\Framework\Log;
6
7
class OutputLogger extends AbstractOutputLogger implements \WebServCo\Framework\Interfaces\OutputLoggerInterface
8
{
9
    public function clear(): bool
10
    {
11
        return false;
12
    }
13
14
    /**
15
    * Logs with an arbitrary level.
16
    *
17
    * Uncommon phpdoc syntax used in order to be compatible with \Psr\Log\LoggerInterface
18
    *
19
    * @param mixed $level
20
    * @param string $message
21
    * @param array<string,mixed> $context
22
    * @throws \Psr\Log\InvalidArgumentException
23
    */
24
    // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
25
    public function log($level, $message, array $context = []): void
26
    {
27
        $this->validateLogLevel($level);
28
29
        // SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
30
        $context = $context;
0 ignored issues
show
Unused Code introduced by
The assignment to $context is dead and can be removed.
Loading history...
31
32
        $this->output($message, true);
33
    }
34
}
35