1 | <?php |
||
9 | final class CommonExpectations |
||
10 | { |
||
11 | use ConditionTrait; |
||
12 | |||
13 | /** |
||
14 | * CommonExpectations constructor. |
||
15 | * |
||
16 | * @param $value |
||
17 | */ |
||
18 | public function __construct($value) |
||
22 | |||
23 | /** |
||
24 | * @param callable $callback |
||
25 | * |
||
26 | * @return CommonExpectations |
||
27 | */ |
||
28 | public function is(callable $callback): self |
||
32 | |||
33 | /** |
||
34 | * @param callable $callback |
||
35 | * |
||
36 | * @return CommonExpectations |
||
37 | */ |
||
38 | public function isNot(callable $callback): self |
||
42 | |||
43 | /** |
||
44 | * @return CommonExpectations |
||
45 | */ |
||
46 | public function isEmpty(): self |
||
50 | |||
51 | /** |
||
52 | * @return CommonExpectations |
||
53 | */ |
||
54 | public function isNotEmpty(): self |
||
58 | |||
59 | /** |
||
60 | * @return CommonExpectations |
||
61 | */ |
||
62 | public function isNull(): self |
||
66 | |||
67 | /** |
||
68 | * @return CommonExpectations |
||
69 | */ |
||
70 | public function isNotNull(): self |
||
74 | |||
75 | /** |
||
76 | * @param $value |
||
77 | * |
||
78 | * @return CommonExpectations |
||
79 | */ |
||
80 | public function isEqual($value): self |
||
84 | |||
85 | /** |
||
86 | * @param $value |
||
87 | * |
||
88 | * @return CommonExpectations |
||
89 | */ |
||
90 | public function isNotEqual($value): self |
||
94 | |||
95 | /** |
||
96 | * @param $value |
||
97 | * |
||
98 | * @return CommonExpectations |
||
99 | */ |
||
100 | public function isIdenticalTo($value): self |
||
104 | |||
105 | /** |
||
106 | * @param $value |
||
107 | * |
||
108 | * @return CommonExpectations |
||
109 | */ |
||
110 | public function isNotIdenticalTo($value): self |
||
114 | |||
115 | /** |
||
116 | * @return IntegerExpectations |
||
117 | */ |
||
118 | public function isInt(): IntegerExpectations |
||
122 | |||
123 | /** |
||
124 | * @return FloatExpectations |
||
125 | */ |
||
126 | public function isFloat(): FloatExpectations |
||
130 | |||
131 | /** |
||
132 | * @return ScalarExpectations |
||
133 | */ |
||
134 | public function isScalar(): ScalarExpectations |
||
138 | |||
139 | /** |
||
140 | * @return NumericExpectations |
||
141 | */ |
||
142 | public function isNumeric(): NumericExpectations |
||
146 | |||
147 | /** |
||
148 | * @return StringExpectations |
||
149 | */ |
||
150 | public function isString(): StringExpectations |
||
154 | |||
155 | /** |
||
156 | * @return BooleanExpectations |
||
157 | */ |
||
158 | public function isBool(): BooleanExpectations |
||
162 | |||
163 | /** |
||
164 | * @return ArrayExpectations |
||
165 | */ |
||
166 | public function isArray(): ArrayExpectations |
||
170 | |||
171 | /** |
||
172 | * @return ObjectExpectations |
||
173 | */ |
||
174 | public function isObject(): ObjectExpectations |
||
178 | |||
179 | /** |
||
180 | * @param $object |
||
181 | * |
||
182 | * @return ObjectExpectations |
||
183 | */ |
||
184 | public function isInstanceOf($object): ObjectExpectations |
||
190 | |||
191 | /** |
||
192 | * @return CommonExpectations |
||
193 | */ |
||
194 | public function isCallable(): self |
||
198 | |||
199 | /** |
||
200 | * @return CommonExpectations |
||
201 | */ |
||
202 | public function isDir(): self |
||
206 | |||
207 | /** |
||
208 | * @return CommonExpectations |
||
209 | */ |
||
210 | public function isFile(): self |
||
214 | |||
215 | /** |
||
216 | * @param float $lhs |
||
217 | * @param float $rhs |
||
218 | * |
||
219 | * @return NumericExpectations |
||
220 | */ |
||
221 | public function isBetween(float $lhs, float $rhs): NumericExpectations |
||
227 | |||
228 | /** |
||
229 | * @param float $value |
||
230 | * |
||
231 | * @return NumericExpectations |
||
232 | */ |
||
233 | public function isBelow(float $value): NumericExpectations |
||
239 | |||
240 | /** |
||
241 | * @param float $value |
||
242 | * |
||
243 | * @return NumericExpectations |
||
244 | */ |
||
245 | public function isAbove(float $value): NumericExpectations |
||
251 | |||
252 | /** |
||
253 | * @param float $value |
||
254 | * |
||
255 | * @return NumericExpectations |
||
256 | */ |
||
257 | public function isBelowOrEqual(float $value): NumericExpectations |
||
263 | |||
264 | /** |
||
265 | * @param float $value |
||
266 | * |
||
267 | * @return NumericExpectations |
||
268 | */ |
||
269 | public function isAboveOrEqual(float $value): NumericExpectations |
||
275 | |||
276 | /** |
||
277 | * @return NumericExpectations |
||
278 | */ |
||
279 | public function isPositive(): NumericExpectations |
||
285 | |||
286 | /** |
||
287 | * @return NumericExpectations |
||
288 | */ |
||
289 | public function isNegative(): NumericExpectations |
||
295 | |||
296 | /** |
||
297 | * @return IntegerExpectations |
||
298 | */ |
||
299 | public function isEven(): IntegerExpectations |
||
305 | |||
306 | /** |
||
307 | * @return IntegerExpectations |
||
308 | */ |
||
309 | public function isOdd(): IntegerExpectations |
||
315 | |||
316 | /** |
||
317 | * @return BooleanExpectations |
||
318 | */ |
||
319 | public function isTrue(): BooleanExpectations |
||
325 | |||
326 | /** |
||
327 | * @return BooleanExpectations |
||
328 | */ |
||
329 | public function isFalse(): BooleanExpectations |
||
335 | |||
336 | /** |
||
337 | * @param string $pattern |
||
338 | * |
||
339 | * @return StringExpectations |
||
340 | */ |
||
341 | public function match(string $pattern): StringExpectations |
||
347 | |||
348 | /** |
||
349 | * @param array $values |
||
350 | * |
||
351 | * @return ArrayValueExpectations |
||
352 | */ |
||
353 | public function isIn(array $values): ArrayValueExpectations |
||
359 | |||
360 | /** |
||
361 | * @param array $values |
||
362 | * |
||
363 | * @return ArrayValueExpectations |
||
364 | */ |
||
365 | public function isKeyOf(array $values): ArrayValueExpectations |
||
371 | |||
372 | /** |
||
373 | * @param int $length |
||
374 | * |
||
375 | * @return ArrayExpectations|StringExpectations |
||
376 | */ |
||
377 | public function hasLength(int $length) |
||
388 | } |