OutputLogger::log()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 3
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