Completed
Push — develop ( f4bf89...9fcb81 )
by Ludwig
02:21
created

RuleConfig   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 10
lcom 1
cbo 0
dl 0
loc 58
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getBodyRules() 0 4 2
A getDSNRules() 0 4 2
A getEmailRules() 0 4 2
A __construct() 0 4 1
A getDiagnosticRegExp() 0 4 2
A getIterator() 0 4 1
1
<?php
2
/*
3
 * This file is part of Bounce-Detection.
4
 *
5
 * (c)2016 cwd.at GmbH <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Cwd\BounceDetection;
11
12
/**
13
 * Class RuleConfig
14
 *
15
 * @package Cwd\BounceDetection
16
 * @author  Ludwig Ruderstaller <[email protected]>
17
 */
18
class RuleConfig implements \IteratorAggregate
19
{
20
    /**
21
     * @var array
22
     */
23
    protected $rules;
24
25
    /**
26
     * RuleConfig constructor.
27
     *
28
     * @param array $rules
29
     */
30 1
    public function __construct(array $rules)
31
    {
32 1
        $this->rules = $rules;
33 1
    }
34
35
    /**
36
     * @return mixed|null
37
     */
38 19
    public function getBodyRules()
39
    {
40 19
        return (isset($this->rules['body'])) ? $this->rules['body'] : null;
41
    }
42
43
    /**
44
     * @return mixed|null
45
     */
46 248
    public function getDSNRules()
47
    {
48 248
        return (isset($this->rules['dsn'])) ? $this->rules['dsn'] : null;
49
    }
50
51
    /**
52
     * @return array
53
     */
54 248
    public function getEmailRules()
55
    {
56 248
        return (isset($this->rules['email'])) ? $this->rules['email'] : null;
57
    }
58
59
    /**
60
     *
61
     * @return string|null
62
     */
63 1
    public function getDiagnosticRegExp()
64
    {
65 1
        return isset($this->rules['diagnostic']) ? $this->rules['diagnostic'] : null;
66
    }
67
68
    /**
69
     * @return \ArrayIterator
70
     */
71 1
    public function getIterator()
72
    {
73 1
        return new \ArrayIterator($this->rules);
74
    }
75
}
76