blob: 897ed25ca3f2dab9a5f741d61afa7c2f189ffe8f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
<?php
namespace ParamProcessor;
/**
* Object for holding options affecting the behavior of a ParamProcessor object.
*
* @since 1.0
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class Options {
private $name;
// During setup
private $unknownInvalid = true;
private $lowercaseNames = true;
private $trimNames = true;
private $acceptOverriding = true;
// During clean
private $trimValues = true;
private $lowercaseValues = false;
// During validation
private $rawStringInputs = true;
public function setName( string $name ) {
$this->name = $name;
}
public function setUnknownInvalid( bool $unknownInvalid ) {
$this->unknownInvalid = $unknownInvalid;
}
public function setLowercaseNames( bool $lowercase ) {
$this->lowercaseNames = $lowercase;
}
public function setRawStringInputs( bool $rawInputs ) {
$this->rawStringInputs = $rawInputs;
}
public function setTrimNames( bool $trim ) {
$this->trimNames = $trim;
}
public function setTrimValues( bool $trim ) {
$this->trimValues = $trim;
}
public function setLowercaseValues( bool $lowercase ) {
$this->lowercaseValues = $lowercase;
}
public function getName(): string {
return $this->name ?? '';
}
public function unknownIsInvalid(): bool {
return $this->unknownInvalid;
}
public function lowercaseNames(): bool {
return $this->lowercaseNames;
}
public function isStringlyTyped(): bool {
return $this->rawStringInputs;
}
public function trimNames(): bool {
return $this->trimNames;
}
public function trimValues(): bool {
return $this->trimValues;
}
public function lowercaseValues(): bool {
return $this->lowercaseValues;
}
public function acceptOverriding(): bool {
return $this->acceptOverriding;
}
}
|