NullLogger::log()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

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