1 | <?php |
||
9 | final class Ensurance implements EnsuranceInterface |
||
10 | { |
||
11 | use EnsuranceTrait; |
||
12 | |||
13 | /** |
||
14 | * Ensurance constructor. |
||
15 | * |
||
16 | * @param mixed $value |
||
17 | */ |
||
18 | public function __construct($value) |
||
23 | 57 | ||
24 | /** |
||
25 | 57 | * @return ArrayEnsurance |
|
26 | 57 | */ |
|
27 | public function isArray(): ArrayEnsurance |
||
33 | |||
34 | /** |
||
35 | * @return ReflectionEnsurance |
||
36 | * @throws \ReflectionException |
||
37 | */ |
||
38 | public function isObject(): ReflectionEnsurance |
||
44 | |||
45 | /** |
||
46 | * @return Ensurance |
||
47 | */ |
||
48 | public function isResource(): self |
||
54 | |||
55 | /** |
||
56 | * @return ScalarEnsurance |
||
57 | */ |
||
58 | public function isScalar(): ScalarEnsurance |
||
64 | |||
65 | /** |
||
66 | * @return StringEnsurance |
||
67 | 26 | */ |
|
68 | public function isString(): StringEnsurance |
||
72 | |||
73 | /** |
||
74 | * @return NumericEnsurance |
||
75 | */ |
||
76 | public function isNumeric(): NumericEnsurance |
||
80 | |||
81 | /** |
||
82 | * @return BooleanEnsurance |
||
83 | */ |
||
84 | public function isBool(): BooleanEnsurance |
||
88 | |||
89 | /** |
||
90 | * @return NumericEnsurance |
||
91 | */ |
||
92 | public function isInt(): NumericEnsurance |
||
96 | |||
97 | /** |
||
98 | * @return NumericEnsurance |
||
99 | */ |
||
100 | public function isFloat(): NumericEnsurance |
||
104 | |||
105 | /** |
||
106 | * @return BooleanEnsurance |
||
107 | */ |
||
108 | public function isTrue(): BooleanEnsurance |
||
112 | |||
113 | /** |
||
114 | * @return BooleanEnsurance |
||
115 | */ |
||
116 | public function isFalse(): BooleanEnsurance |
||
120 | |||
121 | /** |
||
122 | * @return NumericEnsurance |
||
123 | */ |
||
124 | public function isPositive(): NumericEnsurance |
||
128 | |||
129 | /** |
||
130 | * @return NumericEnsurance |
||
131 | */ |
||
132 | public function isNegative(): NumericEnsurance |
||
136 | |||
137 | /** |
||
138 | * @return NumericEnsurance |
||
139 | */ |
||
140 | public function isEven(): NumericEnsurance |
||
144 | |||
145 | /** |
||
146 | * @return NumericEnsurance |
||
147 | */ |
||
148 | public function isOdd(): NumericEnsurance |
||
152 | |||
153 | /** |
||
154 | * @param string $pattern |
||
155 | * |
||
156 | * @return StringEnsurance |
||
157 | 1 | */ |
|
158 | public function matches(string $pattern): StringEnsurance |
||
162 | |||
163 | /** |
||
164 | * @return Ensurance |
||
165 | */ |
||
166 | public function isNull(): self |
||
172 | |||
173 | /** |
||
174 | * @return Ensurance |
||
175 | 1 | */ |
|
176 | public function isNotNull(): self |
||
182 | |||
183 | /** |
||
184 | * @return Ensurance |
||
185 | 1 | */ |
|
186 | public function isEmpty(): self |
||
192 | |||
193 | /** |
||
194 | * @return Ensurance |
||
195 | 1 | */ |
|
196 | public function isNotEmpty(): self |
||
202 | |||
203 | /** |
||
204 | * @param mixed $value |
||
205 | 1 | * |
|
206 | * @return Ensurance |
||
207 | 1 | */ |
|
208 | public function isEqualTo($value): self |
||
214 | |||
215 | /** |
||
216 | * @param mixed $value |
||
217 | 2 | * |
|
218 | * @return Ensurance |
||
219 | 2 | */ |
|
220 | public function isNotEqualTo($value): self |
||
226 | |||
227 | /** |
||
228 | * @param mixed $value |
||
229 | 2 | * |
|
230 | * @return Ensurance |
||
231 | 2 | */ |
|
232 | public function isIdenticalTo($value): self |
||
238 | |||
239 | /** |
||
240 | * @param mixed $value |
||
241 | 1 | * |
|
242 | * @return Ensurance |
||
243 | 1 | */ |
|
244 | public function isNotIdenticalTo($value): self |
||
250 | |||
251 | /** |
||
252 | * @param array $data |
||
253 | 1 | * |
|
254 | * @return Ensurance |
||
255 | 1 | */ |
|
256 | public function isIn(array $data): self |
||
262 | |||
263 | /** |
||
264 | * @param array $data |
||
265 | 2 | * |
|
266 | * @return Ensurance |
||
267 | 2 | */ |
|
268 | public function isKeyOf(array $data): self |
||
274 | |||
275 | /** |
||
276 | * @param float $value |
||
277 | 2 | * |
|
278 | * @return NumericEnsurance |
||
279 | 2 | */ |
|
280 | public function isGreaterThan(float $value): NumericEnsurance |
||
284 | |||
285 | /** |
||
286 | * @param float $value |
||
287 | * |
||
288 | * @return NumericEnsurance |
||
289 | */ |
||
290 | public function isLessThan(float $value): NumericEnsurance |
||
294 | |||
295 | /** |
||
296 | * @param float $value |
||
297 | * |
||
298 | * @return NumericEnsurance |
||
299 | */ |
||
300 | public function isGreaterThanOrEqualTo(float $value): NumericEnsurance |
||
304 | |||
305 | /** |
||
306 | * @param float $value |
||
307 | * |
||
308 | * @return NumericEnsurance |
||
309 | */ |
||
310 | public function isLessThanOrEqualTo(float $value): NumericEnsurance |
||
314 | |||
315 | /** |
||
316 | * @param float $lhs |
||
317 | * @param float $rhs |
||
318 | * |
||
319 | * @return NumericEnsurance |
||
320 | */ |
||
321 | public function isBetween(float $lhs, float $rhs): NumericEnsurance |
||
325 | |||
326 | /** |
||
327 | * @param float $lhs |
||
328 | * @param float $rhs |
||
329 | * |
||
330 | * @return NumericEnsurance |
||
331 | */ |
||
332 | public function isNotBetween(float $lhs, float $rhs): NumericEnsurance |
||
336 | } |
||
337 |