1 | <?php |
||
9 | class Node implements INode { |
||
10 | /** |
||
11 | * @var IConfigSchema |
||
12 | */ |
||
13 | protected $schema; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $key; |
||
19 | |||
20 | /** |
||
21 | * Node constructor. |
||
22 | * |
||
23 | * @param IConfigSchema $schema |
||
24 | * @param string $key |
||
25 | */ |
||
26 | public function __construct(IConfigSchema $schema, $key) { |
||
30 | |||
31 | /** |
||
32 | * @param string $key |
||
33 | * @param string $message |
||
34 | * |
||
35 | * @return IValueNode |
||
36 | */ |
||
37 | public function hasValue($key, $message = null) { |
||
40 | |||
41 | /** |
||
42 | * @param string $key |
||
43 | * @param string $message |
||
44 | * |
||
45 | * @return IStringNode |
||
46 | */ |
||
47 | public function hasString($key, $message = null) { |
||
50 | |||
51 | /** |
||
52 | * @param string $key |
||
53 | * @param string $message |
||
54 | * |
||
55 | * @return INumericNode |
||
56 | */ |
||
57 | public function hasNumber($key, $message = null) { |
||
60 | |||
61 | /** |
||
62 | * @param string $key |
||
63 | * @param string $message |
||
64 | * |
||
65 | * @return IBooleanNode |
||
66 | */ |
||
67 | public function hasBoolean($key, $message = null) { |
||
70 | |||
71 | /** |
||
72 | * @param string $key |
||
73 | * @param string $message |
||
74 | * |
||
75 | * @return IArrayNode |
||
76 | */ |
||
77 | public function hasArray($key, $message = null) { |
||
80 | |||
81 | /** |
||
82 | * @param string $key |
||
83 | * @param string $message |
||
84 | * |
||
85 | * @return IStringNode |
||
86 | */ |
||
87 | public function hasArrayKeys($key, $message = null) { |
||
90 | |||
91 | /** |
||
92 | * @param string $key |
||
93 | * @param string $message |
||
94 | * |
||
95 | * @return IStringNode |
||
96 | */ |
||
97 | public function hasArrayValues($key, $message = null) { |
||
100 | |||
101 | /** |
||
102 | * @return null |
||
103 | */ |
||
104 | public function assert() { |
||
107 | |||
108 | /** |
||
109 | * @return IValidationResult |
||
110 | */ |
||
111 | public function check() { |
||
114 | |||
115 | /** |
||
116 | * @param IConstraint $constraint |
||
117 | * |
||
118 | * @return $this |
||
119 | */ |
||
120 | public function constraint(IConstraint $constraint) { |
||
125 | |||
126 | /** |
||
127 | * @param IConstraint[] $constraints |
||
128 | * |
||
129 | * @return $this |
||
130 | */ |
||
131 | public function constraints(array $constraints) { |
||
136 | } |
||
137 |