NullErrorHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 7
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 4 1
1
<?php
2
3
namespace Nofw\Error;
4
5
/**
6
 * This handler can be used to avoid conditional calls.
7
 *
8
 * Error monitoring should always be optional, and if no handler is provided to your
9
 * library creating a NullHandler instance to have something to throw logs at
10
 * is a good way to avoid littering your code with `if ($this->errorHandler) { }`
11
 * blocks.
12
 *
13
 * @author Márk Sági-Kazár <[email protected]>
14
 */
15
final class NullErrorHandler implements ErrorHandler
16
{
17
    public function handle(\Throwable $t, array $context = []): void
18
    {
19
        // noop
20
    }
21
}
22