Completed
Push — master ( a11ba3...de641c )
by Jeroen De
04:59 queued 02:14
created

Options::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace ParamProcessor;
4
5
/**
6
 * Object for holding options affecting the behavior of a ParamProcessor object.
7
 *
8
 * @since 1.0
9
 *
10
 * @licence GNU GPL v2+
11
 * @author Jeroen De Dauw < [email protected] >
12
 */
13
class Options {
14
15
	private $name;
16
17
	// During setup
18
	private $unknownInvalid = true;
19
	private $lowercaseNames = true;
20
	private $trimNames = true;
21
	private $acceptOverriding = true;
22
23
	// During clean
24
	private $trimValues = true;
25
	private $lowercaseValues = false;
26
27
	// During validation
28
	private $rawStringInputs = true;
29
30
	/**
31
	 * @since 1.0
32
	 *
33
	 * @param string $name
34
	 */
35
	public function setName( $name ) {
36
		$this->name = $name;
37
	}
38
39
	/**
40
	 * @since 1.0
41
	 *
42
	 * @param boolean $unknownInvalid
43
	 */
44
	public function setUnknownInvalid( $unknownInvalid ) {
45
		$this->unknownInvalid = $unknownInvalid;
46
	}
47
48
	/**
49
	 * @since 1.0
50
	 *
51
	 * @param boolean $lowercase
52
	 */
53
	public function setLowercaseNames( $lowercase ) {
54
		$this->lowercaseNames = $lowercase;
55
	}
56
57
	/**
58
	 * @since 1.0
59
	 *
60
	 * @param boolean $rawInputs
61
	 */
62
	public function setRawStringInputs( $rawInputs ) {
63
		$this->rawStringInputs = $rawInputs;
64
	}
65
66
	/**
67
	 * @since 1.0
68
	 *
69
	 * @param boolean $trim
70
	 */
71
	public function setTrimNames( $trim ) {
72
		$this->trimNames = $trim;
73
	}
74
75
	/**
76
	 * @since 1.0
77
	 *
78
	 * @param boolean $trim
79
	 */
80
	public function setTrimValues( $trim ) {
81
		$this->trimValues = $trim;
82
	}
83
84
	/**
85
	 * @since 1.0
86
	 *
87
	 * @param boolean $lowercase
88
	 */
89
	public function setLowercaseValues( $lowercase ) {
90
		$this->lowercaseValues = $lowercase;
91
	}
92
93
	/**
94
	 * @since 1.0
95
	 *
96
	 * @return string
97
	 */
98
	public function getName() {
99
		return $this->name;
100
	}
101
102
	/**
103
	 * @since 1.0
104
	 *
105
	 * @return boolean
106
	 */
107
	public function unknownIsInvalid() {
108
		return $this->unknownInvalid;
109
	}
110
111
	/**
112
	 * @since 1.0
113
	 *
114
	 * @return boolean
115
	 */
116
	public function lowercaseNames() {
117
		return $this->lowercaseNames;
118
	}
119
120
	/**
121
	 * @since 1.0
122
	 *
123
	 * @return boolean
124
	 */
125
	public function isStringlyTyped() {
126
		return $this->rawStringInputs;
127
	}
128
129
	/**
130
	 * @since 1.0
131
	 *
132
	 * @return boolean
133
	 */
134
	public function trimNames() {
135
		return $this->trimNames;
136
	}
137
138
	/**
139
	 * @since 1.0
140
	 *
141
	 * @return boolean
142
	 */
143
	public function trimValues() {
144
		return $this->trimValues;
145
	}
146
147
	/**
148
	 * @since 1.0
149
	 *
150
	 * @return boolean
151
	 */
152
	public function lowercaseValues() {
153
		return $this->lowercaseValues;
154
	}
155
156
	/**
157
	 * @since 1.0
158
	 *
159
	 * @return bool
160
	 */
161
	public function acceptOverriding() {
162
		return $this->acceptOverriding;
163
	}
164
165
}
166