NullLogger   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 1
dl 0
loc 11
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A log() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DanBettles\Defence\Logger;
6
7
use Psr\Log\AbstractLogger;
8
use Stringable;
9
10
/**
11
 * A logger that does nothing.
12
 *
13
 * Use this logger if you aren't interested in what the filters or handler get up to.  You might use it if, for example,
14
 * you're using Defence as an intrusion _prevention_ system and want only to reject suspicious requests.
15
 *
16
 * @phpstan-type Context array<string,mixed>
17
 */
18
class NullLogger extends AbstractLogger
19
{
20
    /**
21
     * @override
22
     * @phpstan-param Context $context
23
     */
24 207
    public function log(
25
        $level,
26
        string|Stringable $message,
27
        array $context = []
28
    ): void {
29 207
    }
30
}
31