Completed
Push — master ( afbcfa...dca8ec )
by Márk
13:11 queued 11:26
created

NullErrorHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

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
    /**
18
     * {@inheritdoc}
19
     */
20
    public function handle(\Throwable $t, array $context = []): void
21
    {
22
        // noop
23
    }
24
}
25