RuleConfig::getEmailRules()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

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