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

NullErrorHandler::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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