Completed
Pull Request — master (#65)
by
unknown
01:48
created

ExcludedErrors::hasExcludedError()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 17
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 7
nc 3
nop 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: dd
5
 * Date: 18.06.2018
6
 * Time: 02:52
7
 */
8
9
namespace Spatie\ServerMonitor\Excluded;
10
11
12
use phpDocumentor\Reflection\Types\Boolean;
13
14
class ExcludedErrors
15
{
16
17
18
19
    public static function getExcludedErrors() : array
20
    {
21
22
        return config("server-monitor.excluded_errors");
23
24
    }
25
26
27
    public static function hasExcludedError(String $errorString) : Bool
28
    {
29
30
        $excludedErrors = self::getExcludedErrors();
31
32
33
34
        foreach ($excludedErrors as $excludedError)
35
        {
36
            $counter=0;
37
            str_replace($excludedError,"_REPLACE_",$errorString,$counter);
38
            if($counter>0) return true;
39
        }
40
41
        return false;
42
43
    }
44
45
46
}