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

ExcludedErrors   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getExcludedErrors() 0 6 1
A hasExcludedError() 0 17 3
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
}