Completed
Push — master ( 7ec665...146f6b )
by personal
08:22 queued 05:17
created

Configuration::setExtensions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
/*
4
 * (c) Jean-François Lépine <https://twitter.com/Halleck45>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Hal\Application\Config;
11
use Hal\Application\Rule\RuleSet;
12
use Hal\Component\Config\ConfigurationInterface;
13
14
/**
15
 * Represents the configuration for analysis
16
 *
17
 * @author Jean-François Lépine <https://twitter.com/Halleck45>
18
 */
19
class Configuration implements ConfigurationInterface
20
{
21
    /**
22
     * RuleSet
23
     *
24
     * @var RuleSet
25
     */
26
    private $ruleset;
27
28
    /**
29
     * @var PathConfiguration
30
     */
31
    private $path;
32
33
    /**
34
     * Condition of failure
35
     *
36
     * @var string
37
     */
38
    private $failureCondition;
39
40
    /**
41
     * Targets of logging
42
     *
43
     * @var LoggingConfiguration
44
     */
45
    private $logging = array();
46
47
    /**
48
     * @var TemplateConfiguration
49
     */
50
    private $template;
51
52
    /**
53
     * @var bool
54
     */
55
    private $ignoreErrors = false;
56
57
    /**
58
     * @var ExtensionsConfiguration
59
     */
60
    private $extensions;
61
62
    /**
63
     * Constructor
64
     */
65
    public function __construct() {
66
        $this->ruleset = new RuleSet();
67
        $this->failureCondition = null;
68
        $this->path = new PathConfiguration();
69
        $this->logging = new LoggingConfiguration();
70
        $this->template = new TemplateConfiguration();
71
        $this->extensions = new ExtensionsConfiguration();
72
    }
73
74
    /**
75
     * @param \Hal\Application\Rule\RuleSet $ruleset
76
     * @return self
77
     */
78
    public function setRuleSet(RuleSet $ruleset)
79
    {
80
        $this->ruleset = $ruleset;
81
        return $this;
82
    }
83
84
    /**
85
     * @return \Hal\Application\Rule\RuleSet
86
     */
87
    public function getRuleSet()
88
    {
89
        return $this->ruleset;
90
    }
91
92
    /**
93
     * @param string $failureCondition
94
     * @return self
95
     */
96
    public function setFailureCondition($failureCondition)
97
    {
98
        $this->failureCondition = $failureCondition;
99
        return $this;
100
    }
101
102
    /**
103
     * @return string
104
     */
105
    public function getFailureCondition()
106
    {
107
        return $this->failureCondition;
108
    }
109
110
    /**
111
     * @param LoggingConfiguration $logging
112
     * @return self
113
     */
114
    public function setLogging(LoggingConfiguration $logging)
115
    {
116
        $this->logging = $logging;
117
        return $this;
118
    }
119
120
    /**
121
     * @return LoggingConfiguration
122
     */
123
    public function getLogging()
124
    {
125
        return $this->logging;
126
    }
127
128
    /**
129
     * @param PathConfiguration $path
130
     * @return self
131
     */
132
    public function setPath($path)
133
    {
134
        $this->path = $path;
135
        return $this;
136
    }
137
138
    /**
139
     * @return PathConfiguration
140
     */
141
    public function getPath()
142
    {
143
        return $this->path;
144
    }
145
146
    /**
147
     * @param TemplateConfiguration $template
148
     * @return self
149
     */
150
    public function setTemplate($template)
151
    {
152
        $this->template = $template;
153
        return $this;
154
    }
155
156
    /**
157
     * @return TemplateConfiguration
158
     */
159
    public function getTemplate()
160
    {
161
        return $this->template;
162
    }
163
164
    /**
165
     * @return boolean
166
     */
167
    public function getIgnoreErrors()
168
    {
169
        return $this->ignoreErrors;
170
    }
171
172
    /**
173
     * @param boolean $ignoreErrors
174
     * @return $this
175
     */
176
    public function setIgnoreErrors($ignoreErrors)
177
    {
178
        $this->ignoreErrors = $ignoreErrors;
179
        return $this;
180
    }
181
182
    /**
183
     * @return array
184
     */
185
    public function getExtensions()
186
    {
187
        return $this->extensions;
188
    }
189
190
    /**
191
     * @param ExtensionsConfiguration $extensions
192
     * @return Configuration
193
     */
194
    public function setExtensions(ExtensionsConfiguration $extensions)
195
    {
196
        $this->extensions = $extensions;
197
        return $this;
198
    }
199
200
}