Passed
Push — master ( 89f24e...8c4dad )
by Sylvain
08:05
created

NoMail   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A filter() 0 9 4
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ecodev\Felix\Log\Filter;
6
7
use GraphQL\Error\Error;
8
use Laminas\Log\Filter\FilterInterface;
9
10
final class NoMail implements FilterInterface
11
{
12
    /**
13
     * Ignore exception that are explicitly marked as ignored
14
     */
15 14
    public function filter(array $event): bool
16
    {
17 14
        $exception = $event['extra']['exception'] ?? null;
18
19 14
        if ($exception instanceof NoMailLogging || ($exception instanceof Error && $exception->getPrevious() instanceof NoMailLogging)) {
20 3
            return false;
21
        }
22
23 11
        return true;
24
    }
25
}
26