Complex classes like Mixin often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Mixin, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
19 | trait Mixin |
||
20 | { |
||
21 | /** |
||
22 | * @psalm-pure |
||
23 | * @psalm-assert string|null $value |
||
24 | * |
||
25 | * @param mixed $value |
||
26 | * @param string $message |
||
27 | * |
||
28 | * @throws InvalidArgumentException |
||
29 | * |
||
30 | * @return void |
||
31 | */ |
||
32 | public static function nullOrString($value, $message = '') |
||
36 | |||
37 | /** |
||
38 | * @psalm-pure |
||
39 | * @psalm-assert iterable<string> $value |
||
40 | * |
||
41 | * @param mixed $value |
||
42 | * @param string $message |
||
43 | * |
||
44 | * @throws InvalidArgumentException |
||
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | public static function allString($value, $message = '') |
||
52 | |||
53 | /** |
||
54 | * @psalm-pure |
||
55 | * @psalm-assert non-empty-string|null $value |
||
56 | * |
||
57 | * @param mixed $value |
||
58 | * @param string $message |
||
59 | * |
||
60 | * @throws InvalidArgumentException |
||
61 | * |
||
62 | * @return void |
||
63 | */ |
||
64 | public static function nullOrStringNotEmpty($value, $message = '') |
||
68 | |||
69 | /** |
||
70 | * @psalm-pure |
||
71 | * @psalm-assert iterable<non-empty-string> $value |
||
72 | * |
||
73 | * @param mixed $value |
||
74 | * @param string $message |
||
75 | * |
||
76 | * @throws InvalidArgumentException |
||
77 | * |
||
78 | * @return void |
||
79 | */ |
||
80 | public static function allStringNotEmpty($value, $message = '') |
||
84 | |||
85 | /** |
||
86 | * @psalm-pure |
||
87 | * @psalm-assert int|null $value |
||
88 | * |
||
89 | * @param mixed $value |
||
90 | * @param string $message |
||
91 | * |
||
92 | * @throws InvalidArgumentException |
||
93 | * |
||
94 | * @return void |
||
95 | */ |
||
96 | public static function nullOrInteger($value, $message = '') |
||
100 | |||
101 | /** |
||
102 | * @psalm-pure |
||
103 | * @psalm-assert iterable<int> $value |
||
104 | * |
||
105 | * @param mixed $value |
||
106 | * @param string $message |
||
107 | * |
||
108 | * @throws InvalidArgumentException |
||
109 | * |
||
110 | * @return void |
||
111 | */ |
||
112 | public static function allInteger($value, $message = '') |
||
116 | |||
117 | /** |
||
118 | * @psalm-pure |
||
119 | * @psalm-assert numeric|null $value |
||
120 | * |
||
121 | * @param mixed $value |
||
122 | * @param string $message |
||
123 | * |
||
124 | * @throws InvalidArgumentException |
||
125 | * |
||
126 | * @return void |
||
127 | */ |
||
128 | public static function nullOrIntegerish($value, $message = '') |
||
132 | |||
133 | /** |
||
134 | * @psalm-pure |
||
135 | * @psalm-assert iterable<numeric> $value |
||
136 | * |
||
137 | * @param mixed $value |
||
138 | * @param string $message |
||
139 | * |
||
140 | * @throws InvalidArgumentException |
||
141 | * |
||
142 | * @return void |
||
143 | */ |
||
144 | public static function allIntegerish($value, $message = '') |
||
148 | |||
149 | /** |
||
150 | * @psalm-pure |
||
151 | * @psalm-assert positive-int|null $value |
||
152 | * |
||
153 | * @param mixed $value |
||
154 | * @param string $message |
||
155 | * |
||
156 | * @throws InvalidArgumentException |
||
157 | * |
||
158 | * @return void |
||
159 | */ |
||
160 | public static function nullOrPositiveInteger($value, $message = '') |
||
164 | |||
165 | /** |
||
166 | * @psalm-pure |
||
167 | * @psalm-assert iterable<positive-int> $value |
||
168 | * |
||
169 | * @param mixed $value |
||
170 | * @param string $message |
||
171 | * |
||
172 | * @throws InvalidArgumentException |
||
173 | * |
||
174 | * @return void |
||
175 | */ |
||
176 | public static function allPositiveInteger($value, $message = '') |
||
180 | |||
181 | /** |
||
182 | * @psalm-pure |
||
183 | * @psalm-assert float|null $value |
||
184 | * |
||
185 | * @param mixed $value |
||
186 | * @param string $message |
||
187 | * |
||
188 | * @throws InvalidArgumentException |
||
189 | * |
||
190 | * @return void |
||
191 | */ |
||
192 | public static function nullOrFloat($value, $message = '') |
||
196 | |||
197 | /** |
||
198 | * @psalm-pure |
||
199 | * @psalm-assert iterable<float> $value |
||
200 | * |
||
201 | * @param mixed $value |
||
202 | * @param string $message |
||
203 | * |
||
204 | * @throws InvalidArgumentException |
||
205 | * |
||
206 | * @return void |
||
207 | */ |
||
208 | public static function allFloat($value, $message = '') |
||
212 | |||
213 | /** |
||
214 | * @psalm-pure |
||
215 | * @psalm-assert numeric|null $value |
||
216 | * |
||
217 | * @param mixed $value |
||
218 | * @param string $message |
||
219 | * |
||
220 | * @throws InvalidArgumentException |
||
221 | * |
||
222 | * @return void |
||
223 | */ |
||
224 | public static function nullOrNumeric($value, $message = '') |
||
228 | |||
229 | /** |
||
230 | * @psalm-pure |
||
231 | * @psalm-assert iterable<numeric> $value |
||
232 | * |
||
233 | * @param mixed $value |
||
234 | * @param string $message |
||
235 | * |
||
236 | * @throws InvalidArgumentException |
||
237 | * |
||
238 | * @return void |
||
239 | */ |
||
240 | public static function allNumeric($value, $message = '') |
||
244 | |||
245 | /** |
||
246 | * @psalm-pure |
||
247 | * @psalm-assert positive-int|0|null $value |
||
248 | * |
||
249 | * @param mixed $value |
||
250 | * @param string $message |
||
251 | * |
||
252 | * @throws InvalidArgumentException |
||
253 | * |
||
254 | * @return void |
||
255 | */ |
||
256 | public static function nullOrNatural($value, $message = '') |
||
260 | |||
261 | /** |
||
262 | * @psalm-pure |
||
263 | * @psalm-assert iterable<positive-int|0> $value |
||
264 | * |
||
265 | * @param mixed $value |
||
266 | * @param string $message |
||
267 | * |
||
268 | * @throws InvalidArgumentException |
||
269 | * |
||
270 | * @return void |
||
271 | */ |
||
272 | public static function allNatural($value, $message = '') |
||
276 | |||
277 | /** |
||
278 | * @psalm-pure |
||
279 | * @psalm-assert bool|null $value |
||
280 | * |
||
281 | * @param mixed $value |
||
282 | * @param string $message |
||
283 | * |
||
284 | * @throws InvalidArgumentException |
||
285 | * |
||
286 | * @return void |
||
287 | */ |
||
288 | public static function nullOrBoolean($value, $message = '') |
||
292 | |||
293 | /** |
||
294 | * @psalm-pure |
||
295 | * @psalm-assert iterable<bool> $value |
||
296 | * |
||
297 | * @param mixed $value |
||
298 | * @param string $message |
||
299 | * |
||
300 | * @throws InvalidArgumentException |
||
301 | * |
||
302 | * @return void |
||
303 | */ |
||
304 | public static function allBoolean($value, $message = '') |
||
308 | |||
309 | /** |
||
310 | * @psalm-pure |
||
311 | * @psalm-assert scalar|null $value |
||
312 | * |
||
313 | * @param mixed $value |
||
314 | * @param string $message |
||
315 | * |
||
316 | * @throws InvalidArgumentException |
||
317 | * |
||
318 | * @return void |
||
319 | */ |
||
320 | public static function nullOrScalar($value, $message = '') |
||
324 | |||
325 | /** |
||
326 | * @psalm-pure |
||
327 | * @psalm-assert iterable<scalar> $value |
||
328 | * |
||
329 | * @param mixed $value |
||
330 | * @param string $message |
||
331 | * |
||
332 | * @throws InvalidArgumentException |
||
333 | * |
||
334 | * @return void |
||
335 | */ |
||
336 | public static function allScalar($value, $message = '') |
||
340 | |||
341 | /** |
||
342 | * @psalm-pure |
||
343 | * @psalm-assert object|null $value |
||
344 | * |
||
345 | * @param mixed $value |
||
346 | * @param string $message |
||
347 | * |
||
348 | * @throws InvalidArgumentException |
||
349 | * |
||
350 | * @return void |
||
351 | */ |
||
352 | public static function nullOrObject($value, $message = '') |
||
356 | |||
357 | /** |
||
358 | * @psalm-pure |
||
359 | * @psalm-assert iterable<object> $value |
||
360 | * |
||
361 | * @param mixed $value |
||
362 | * @param string $message |
||
363 | * |
||
364 | * @throws InvalidArgumentException |
||
365 | * |
||
366 | * @return void |
||
367 | */ |
||
368 | public static function allObject($value, $message = '') |
||
372 | |||
373 | /** |
||
374 | * @psalm-pure |
||
375 | * @psalm-assert resource|null $value |
||
376 | * |
||
377 | * @param mixed $value |
||
378 | * @param string|null $type type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php |
||
379 | * @param string $message |
||
380 | * |
||
381 | * @throws InvalidArgumentException |
||
382 | * |
||
383 | * @return void |
||
384 | */ |
||
385 | public static function nullOrResource($value, $type = null, $message = '') |
||
389 | |||
390 | /** |
||
391 | * @psalm-pure |
||
392 | * @psalm-assert iterable<resource> $value |
||
393 | * |
||
394 | * @param mixed $value |
||
395 | * @param string|null $type type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php |
||
396 | * @param string $message |
||
397 | * |
||
398 | * @throws InvalidArgumentException |
||
399 | * |
||
400 | * @return void |
||
401 | */ |
||
402 | public static function allResource($value, $type = null, $message = '') |
||
406 | |||
407 | /** |
||
408 | * @psalm-pure |
||
409 | * @psalm-assert callable|null $value |
||
410 | * |
||
411 | * @param mixed $value |
||
412 | * @param string $message |
||
413 | * |
||
414 | * @throws InvalidArgumentException |
||
415 | * |
||
416 | * @return void |
||
417 | */ |
||
418 | public static function nullOrIsCallable($value, $message = '') |
||
422 | |||
423 | /** |
||
424 | * @psalm-pure |
||
425 | * @psalm-assert iterable<callable> $value |
||
426 | * |
||
427 | * @param mixed $value |
||
428 | * @param string $message |
||
429 | * |
||
430 | * @throws InvalidArgumentException |
||
431 | * |
||
432 | * @return void |
||
433 | */ |
||
434 | public static function allIsCallable($value, $message = '') |
||
438 | |||
439 | /** |
||
440 | * @psalm-pure |
||
441 | * @psalm-assert array|null $value |
||
442 | * |
||
443 | * @param mixed $value |
||
444 | * @param string $message |
||
445 | * |
||
446 | * @throws InvalidArgumentException |
||
447 | * |
||
448 | * @return void |
||
449 | */ |
||
450 | public static function nullOrIsArray($value, $message = '') |
||
454 | |||
455 | /** |
||
456 | * @psalm-pure |
||
457 | * @psalm-assert iterable<array> $value |
||
458 | * |
||
459 | * @param mixed $value |
||
460 | * @param string $message |
||
461 | * |
||
462 | * @throws InvalidArgumentException |
||
463 | * |
||
464 | * @return void |
||
465 | */ |
||
466 | public static function allIsArray($value, $message = '') |
||
470 | |||
471 | /** |
||
472 | * @psalm-pure |
||
473 | * @psalm-assert iterable|null $value |
||
474 | * |
||
475 | * @deprecated use "isIterable" or "isInstanceOf" instead |
||
476 | * |
||
477 | * @param mixed $value |
||
478 | * @param string $message |
||
479 | * |
||
480 | * @throws InvalidArgumentException |
||
481 | * |
||
482 | * @return void |
||
483 | */ |
||
484 | public static function nullOrIsTraversable($value, $message = '') |
||
488 | |||
489 | /** |
||
490 | * @psalm-pure |
||
491 | * @psalm-assert iterable<iterable> $value |
||
492 | * |
||
493 | * @deprecated use "isIterable" or "isInstanceOf" instead |
||
494 | * |
||
495 | * @param mixed $value |
||
496 | * @param string $message |
||
497 | * |
||
498 | * @throws InvalidArgumentException |
||
499 | * |
||
500 | * @return void |
||
501 | */ |
||
502 | public static function allIsTraversable($value, $message = '') |
||
506 | |||
507 | /** |
||
508 | * @psalm-pure |
||
509 | * @psalm-assert array|ArrayAccess|null $value |
||
510 | * |
||
511 | * @param mixed $value |
||
512 | * @param string $message |
||
513 | * |
||
514 | * @throws InvalidArgumentException |
||
515 | * |
||
516 | * @return void |
||
517 | */ |
||
518 | public static function nullOrIsArrayAccessible($value, $message = '') |
||
522 | |||
523 | /** |
||
524 | * @psalm-pure |
||
525 | * @psalm-assert iterable<array|ArrayAccess> $value |
||
526 | * |
||
527 | * @param mixed $value |
||
528 | * @param string $message |
||
529 | * |
||
530 | * @throws InvalidArgumentException |
||
531 | * |
||
532 | * @return void |
||
533 | */ |
||
534 | public static function allIsArrayAccessible($value, $message = '') |
||
538 | |||
539 | /** |
||
540 | * @psalm-pure |
||
541 | * @psalm-assert countable|null $value |
||
542 | * |
||
543 | * @param mixed $value |
||
544 | * @param string $message |
||
545 | * |
||
546 | * @throws InvalidArgumentException |
||
547 | * |
||
548 | * @return void |
||
549 | */ |
||
550 | public static function nullOrIsCountable($value, $message = '') |
||
554 | |||
555 | /** |
||
556 | * @psalm-pure |
||
557 | * @psalm-assert iterable<countable> $value |
||
558 | * |
||
559 | * @param mixed $value |
||
560 | * @param string $message |
||
561 | * |
||
562 | * @throws InvalidArgumentException |
||
563 | * |
||
564 | * @return void |
||
565 | */ |
||
566 | public static function allIsCountable($value, $message = '') |
||
570 | |||
571 | /** |
||
572 | * @psalm-pure |
||
573 | * @psalm-assert iterable|null $value |
||
574 | * |
||
575 | * @param mixed $value |
||
576 | * @param string $message |
||
577 | * |
||
578 | * @throws InvalidArgumentException |
||
579 | * |
||
580 | * @return void |
||
581 | */ |
||
582 | public static function nullOrIsIterable($value, $message = '') |
||
586 | |||
587 | /** |
||
588 | * @psalm-pure |
||
589 | * @psalm-assert iterable<iterable> $value |
||
590 | * |
||
591 | * @param mixed $value |
||
592 | * @param string $message |
||
593 | * |
||
594 | * @throws InvalidArgumentException |
||
595 | * |
||
596 | * @return void |
||
597 | */ |
||
598 | public static function allIsIterable($value, $message = '') |
||
602 | |||
603 | /** |
||
604 | * @psalm-pure |
||
605 | * @psalm-template ExpectedType of object |
||
606 | * @psalm-param class-string<ExpectedType> $class |
||
607 | * @psalm-assert ExpectedType|null $value |
||
608 | * |
||
609 | * @param mixed $value |
||
610 | * @param string|object $class |
||
611 | * @param string $message |
||
612 | * |
||
613 | * @throws InvalidArgumentException |
||
614 | * |
||
615 | * @return void |
||
616 | */ |
||
617 | public static function nullOrIsInstanceOf($value, $class, $message = '') |
||
621 | |||
622 | /** |
||
623 | * @psalm-pure |
||
624 | * @psalm-template ExpectedType of object |
||
625 | * @psalm-param class-string<ExpectedType> $class |
||
626 | * @psalm-assert iterable<ExpectedType> $value |
||
627 | * |
||
628 | * @param mixed $value |
||
629 | * @param string|object $class |
||
630 | * @param string $message |
||
631 | * |
||
632 | * @throws InvalidArgumentException |
||
633 | * |
||
634 | * @return void |
||
635 | */ |
||
636 | public static function allIsInstanceOf($value, $class, $message = '') |
||
640 | |||
641 | /** |
||
642 | * @psalm-pure |
||
643 | * @psalm-template ExpectedType of object |
||
644 | * @psalm-param class-string<ExpectedType> $class |
||
645 | * |
||
646 | * @param mixed $value |
||
647 | * @param string|object $class |
||
648 | * @param string $message |
||
649 | * |
||
650 | * @throws InvalidArgumentException |
||
651 | * |
||
652 | * @return void |
||
653 | */ |
||
654 | public static function nullOrNotInstanceOf($value, $class, $message = '') |
||
658 | |||
659 | /** |
||
660 | * @psalm-pure |
||
661 | * @psalm-template ExpectedType of object |
||
662 | * @psalm-param class-string<ExpectedType> $class |
||
663 | * |
||
664 | * @param mixed $value |
||
665 | * @param string|object $class |
||
666 | * @param string $message |
||
667 | * |
||
668 | * @throws InvalidArgumentException |
||
669 | * |
||
670 | * @return void |
||
671 | */ |
||
672 | public static function allNotInstanceOf($value, $class, $message = '') |
||
676 | |||
677 | /** |
||
678 | * @psalm-pure |
||
679 | * @psalm-param array<class-string> $classes |
||
680 | * |
||
681 | * @param mixed $value |
||
682 | * @param array<object|string> $classes |
||
683 | * @param string $message |
||
684 | * |
||
685 | * @throws InvalidArgumentException |
||
686 | * |
||
687 | * @return void |
||
688 | */ |
||
689 | public static function nullOrIsInstanceOfAny($value, $classes, $message = '') |
||
693 | |||
694 | /** |
||
695 | * @psalm-pure |
||
696 | * @psalm-param array<class-string> $classes |
||
697 | * |
||
698 | * @param mixed $value |
||
699 | * @param array<object|string> $classes |
||
700 | * @param string $message |
||
701 | * |
||
702 | * @throws InvalidArgumentException |
||
703 | * |
||
704 | * @return void |
||
705 | */ |
||
706 | public static function allIsInstanceOfAny($value, $classes, $message = '') |
||
710 | |||
711 | /** |
||
712 | * @psalm-pure |
||
713 | * @psalm-template ExpectedType of object |
||
714 | * @psalm-param class-string<ExpectedType> $class |
||
715 | * @psalm-assert ExpectedType|class-string<ExpectedType>|null $value |
||
716 | * |
||
717 | * @param object|string|null $value |
||
718 | * @param string $class |
||
719 | * @param string $message |
||
720 | * |
||
721 | * @throws InvalidArgumentException |
||
722 | * |
||
723 | * @return void |
||
724 | */ |
||
725 | public static function nullOrIsAOf($value, $class, $message = '') |
||
729 | |||
730 | /** |
||
731 | * @psalm-pure |
||
732 | * @psalm-template ExpectedType of object |
||
733 | * @psalm-param class-string<ExpectedType> $class |
||
734 | * @psalm-assert iterable<ExpectedType|class-string<ExpectedType>> $value |
||
735 | * |
||
736 | * @param iterable<object|string> $value |
||
|
|||
737 | * @param string $class |
||
738 | * @param string $message |
||
739 | * |
||
740 | * @throws InvalidArgumentException |
||
741 | * |
||
742 | * @return void |
||
743 | */ |
||
744 | public static function allIsAOf($value, $class, $message = '') |
||
748 | |||
749 | /** |
||
750 | * @psalm-pure |
||
751 | * @psalm-template UnexpectedType of object |
||
752 | * @psalm-param class-string<UnexpectedType> $class |
||
753 | * |
||
754 | * @param object|string|null $value |
||
755 | * @param string $class |
||
756 | * @param string $message |
||
757 | * |
||
758 | * @throws InvalidArgumentException |
||
759 | * |
||
760 | * @return void |
||
761 | */ |
||
762 | public static function nullOrIsNotA($value, $class, $message = '') |
||
766 | |||
767 | /** |
||
768 | * @psalm-pure |
||
769 | * @psalm-template UnexpectedType of object |
||
770 | * @psalm-param class-string<UnexpectedType> $class |
||
771 | * |
||
772 | * @param iterable<object|string> $value |
||
773 | * @param string $class |
||
774 | * @param string $message |
||
775 | * |
||
776 | * @throws InvalidArgumentException |
||
777 | * |
||
778 | * @return void |
||
779 | */ |
||
780 | public static function allIsNotA($value, $class, $message = '') |
||
784 | |||
785 | /** |
||
786 | * @psalm-pure |
||
787 | * @psalm-param array<class-string> $classes |
||
788 | * |
||
789 | * @param object|string|null $value |
||
790 | * @param string[] $classes |
||
791 | * @param string $message |
||
792 | * |
||
793 | * @throws InvalidArgumentException |
||
794 | * |
||
795 | * @return void |
||
796 | */ |
||
797 | public static function nullOrIsAnyOf($value, $classes, $message = '') |
||
801 | |||
802 | /** |
||
803 | * @psalm-pure |
||
804 | * @psalm-param array<class-string> $classes |
||
805 | * |
||
806 | * @param iterable<object|string> $value |
||
807 | * @param string[] $classes |
||
808 | * @param string $message |
||
809 | * |
||
810 | * @throws InvalidArgumentException |
||
811 | * |
||
812 | * @return void |
||
813 | */ |
||
814 | public static function allIsAnyOf($value, $classes, $message = '') |
||
818 | |||
819 | /** |
||
820 | * @psalm-pure |
||
821 | * @psalm-assert empty $value |
||
822 | * |
||
823 | * @param mixed $value |
||
824 | * @param string $message |
||
825 | * |
||
826 | * @throws InvalidArgumentException |
||
827 | * |
||
828 | * @return void |
||
829 | */ |
||
830 | public static function nullOrIsEmpty($value, $message = '') |
||
834 | |||
835 | /** |
||
836 | * @psalm-pure |
||
837 | * @psalm-assert iterable<empty> $value |
||
838 | * |
||
839 | * @param mixed $value |
||
840 | * @param string $message |
||
841 | * |
||
842 | * @throws InvalidArgumentException |
||
843 | * |
||
844 | * @return void |
||
845 | */ |
||
846 | public static function allIsEmpty($value, $message = '') |
||
850 | |||
851 | /** |
||
852 | * @psalm-pure |
||
853 | * |
||
854 | * @param mixed $value |
||
855 | * @param string $message |
||
856 | * |
||
857 | * @throws InvalidArgumentException |
||
858 | * |
||
859 | * @return void |
||
860 | */ |
||
861 | public static function nullOrNotEmpty($value, $message = '') |
||
865 | |||
866 | /** |
||
867 | * @psalm-pure |
||
868 | * |
||
869 | * @param mixed $value |
||
870 | * @param string $message |
||
871 | * |
||
872 | * @throws InvalidArgumentException |
||
873 | * |
||
874 | * @return void |
||
875 | */ |
||
876 | public static function allNotEmpty($value, $message = '') |
||
880 | |||
881 | /** |
||
882 | * @psalm-pure |
||
883 | * @psalm-assert iterable<null> $value |
||
884 | * |
||
885 | * @param mixed $value |
||
886 | * @param string $message |
||
887 | * |
||
888 | * @throws InvalidArgumentException |
||
889 | * |
||
890 | * @return void |
||
891 | */ |
||
892 | public static function allNull($value, $message = '') |
||
896 | |||
897 | /** |
||
898 | * @psalm-pure |
||
899 | * |
||
900 | * @param mixed $value |
||
901 | * @param string $message |
||
902 | * |
||
903 | * @throws InvalidArgumentException |
||
904 | * |
||
905 | * @return void |
||
906 | */ |
||
907 | public static function allNotNull($value, $message = '') |
||
911 | |||
912 | /** |
||
913 | * @psalm-pure |
||
914 | * @psalm-assert true|null $value |
||
915 | * |
||
916 | * @param mixed $value |
||
917 | * @param string $message |
||
918 | * |
||
919 | * @throws InvalidArgumentException |
||
920 | * |
||
921 | * @return void |
||
922 | */ |
||
923 | public static function nullOrTrue($value, $message = '') |
||
927 | |||
928 | /** |
||
929 | * @psalm-pure |
||
930 | * @psalm-assert iterable<true> $value |
||
931 | * |
||
932 | * @param mixed $value |
||
933 | * @param string $message |
||
934 | * |
||
935 | * @throws InvalidArgumentException |
||
936 | * |
||
937 | * @return void |
||
938 | */ |
||
939 | public static function allTrue($value, $message = '') |
||
943 | |||
944 | /** |
||
945 | * @psalm-pure |
||
946 | * @psalm-assert false|null $value |
||
947 | * |
||
948 | * @param mixed $value |
||
949 | * @param string $message |
||
950 | * |
||
951 | * @throws InvalidArgumentException |
||
952 | * |
||
953 | * @return void |
||
954 | */ |
||
955 | public static function nullOrFalse($value, $message = '') |
||
959 | |||
960 | /** |
||
961 | * @psalm-pure |
||
962 | * @psalm-assert iterable<false> $value |
||
963 | * |
||
964 | * @param mixed $value |
||
965 | * @param string $message |
||
966 | * |
||
967 | * @throws InvalidArgumentException |
||
968 | * |
||
969 | * @return void |
||
970 | */ |
||
971 | public static function allFalse($value, $message = '') |
||
975 | |||
976 | /** |
||
977 | * @psalm-pure |
||
978 | * |
||
979 | * @param mixed $value |
||
980 | * @param string $message |
||
981 | * |
||
982 | * @throws InvalidArgumentException |
||
983 | * |
||
984 | * @return void |
||
985 | */ |
||
986 | public static function nullOrNotFalse($value, $message = '') |
||
990 | |||
991 | /** |
||
992 | * @psalm-pure |
||
993 | * |
||
994 | * @param mixed $value |
||
995 | * @param string $message |
||
996 | * |
||
997 | * @throws InvalidArgumentException |
||
998 | * |
||
999 | * @return void |
||
1000 | */ |
||
1001 | public static function allNotFalse($value, $message = '') |
||
1005 | |||
1006 | /** |
||
1007 | * @param mixed $value |
||
1008 | * @param string $message |
||
1009 | * |
||
1010 | * @throws InvalidArgumentException |
||
1011 | * |
||
1012 | * @return void |
||
1013 | */ |
||
1014 | public static function nullOrIp($value, $message = '') |
||
1018 | |||
1019 | /** |
||
1020 | * @param mixed $value |
||
1021 | * @param string $message |
||
1022 | * |
||
1023 | * @throws InvalidArgumentException |
||
1024 | * |
||
1025 | * @return void |
||
1026 | */ |
||
1027 | public static function allIp($value, $message = '') |
||
1031 | |||
1032 | /** |
||
1033 | * @param mixed $value |
||
1034 | * @param string $message |
||
1035 | * |
||
1036 | * @throws InvalidArgumentException |
||
1037 | * |
||
1038 | * @return void |
||
1039 | */ |
||
1040 | public static function nullOrIpv4($value, $message = '') |
||
1044 | |||
1045 | /** |
||
1046 | * @param mixed $value |
||
1047 | * @param string $message |
||
1048 | * |
||
1049 | * @throws InvalidArgumentException |
||
1050 | * |
||
1051 | * @return void |
||
1052 | */ |
||
1053 | public static function allIpv4($value, $message = '') |
||
1057 | |||
1058 | /** |
||
1059 | * @param mixed $value |
||
1060 | * @param string $message |
||
1061 | * |
||
1062 | * @throws InvalidArgumentException |
||
1063 | * |
||
1064 | * @return void |
||
1065 | */ |
||
1066 | public static function nullOrIpv6($value, $message = '') |
||
1070 | |||
1071 | /** |
||
1072 | * @param mixed $value |
||
1073 | * @param string $message |
||
1074 | * |
||
1075 | * @throws InvalidArgumentException |
||
1076 | * |
||
1077 | * @return void |
||
1078 | */ |
||
1079 | public static function allIpv6($value, $message = '') |
||
1083 | |||
1084 | /** |
||
1085 | * @param mixed $value |
||
1086 | * @param string $message |
||
1087 | * |
||
1088 | * @throws InvalidArgumentException |
||
1089 | * |
||
1090 | * @return void |
||
1091 | */ |
||
1092 | public static function nullOrEmail($value, $message = '') |
||
1096 | |||
1097 | /** |
||
1098 | * @param mixed $value |
||
1099 | * @param string $message |
||
1100 | * |
||
1101 | * @throws InvalidArgumentException |
||
1102 | * |
||
1103 | * @return void |
||
1104 | */ |
||
1105 | public static function allEmail($value, $message = '') |
||
1109 | |||
1110 | /** |
||
1111 | * @param array|null $values |
||
1112 | * @param string $message |
||
1113 | * |
||
1114 | * @throws InvalidArgumentException |
||
1115 | * |
||
1116 | * @return void |
||
1117 | */ |
||
1118 | public static function nullOrUniqueValues($values, $message = '') |
||
1122 | |||
1123 | /** |
||
1124 | * @param iterable<array> $values |
||
1125 | * @param string $message |
||
1126 | * |
||
1127 | * @throws InvalidArgumentException |
||
1128 | * |
||
1129 | * @return void |
||
1130 | */ |
||
1131 | public static function allUniqueValues($values, $message = '') |
||
1135 | |||
1136 | /** |
||
1137 | * @param mixed $value |
||
1138 | * @param mixed $expect |
||
1139 | * @param string $message |
||
1140 | * |
||
1141 | * @throws InvalidArgumentException |
||
1142 | * |
||
1143 | * @return void |
||
1144 | */ |
||
1145 | public static function nullOrEq($value, $expect, $message = '') |
||
1149 | |||
1150 | /** |
||
1151 | * @param mixed $value |
||
1152 | * @param mixed $expect |
||
1153 | * @param string $message |
||
1154 | * |
||
1155 | * @throws InvalidArgumentException |
||
1156 | * |
||
1157 | * @return void |
||
1158 | */ |
||
1159 | public static function allEq($value, $expect, $message = '') |
||
1163 | |||
1164 | /** |
||
1165 | * @param mixed $value |
||
1166 | * @param mixed $expect |
||
1167 | * @param string $message |
||
1168 | * |
||
1169 | * @throws InvalidArgumentException |
||
1170 | * |
||
1171 | * @return void |
||
1172 | */ |
||
1173 | public static function nullOrNotEq($value, $expect, $message = '') |
||
1177 | |||
1178 | /** |
||
1179 | * @param mixed $value |
||
1180 | * @param mixed $expect |
||
1181 | * @param string $message |
||
1182 | * |
||
1183 | * @throws InvalidArgumentException |
||
1184 | * |
||
1185 | * @return void |
||
1186 | */ |
||
1187 | public static function allNotEq($value, $expect, $message = '') |
||
1191 | |||
1192 | /** |
||
1193 | * @psalm-pure |
||
1194 | * |
||
1195 | * @param mixed $value |
||
1196 | * @param mixed $expect |
||
1197 | * @param string $message |
||
1198 | * |
||
1199 | * @throws InvalidArgumentException |
||
1200 | * |
||
1201 | * @return void |
||
1202 | */ |
||
1203 | public static function nullOrSame($value, $expect, $message = '') |
||
1207 | |||
1208 | /** |
||
1209 | * @psalm-pure |
||
1210 | * |
||
1211 | * @param mixed $value |
||
1212 | * @param mixed $expect |
||
1213 | * @param string $message |
||
1214 | * |
||
1215 | * @throws InvalidArgumentException |
||
1216 | * |
||
1217 | * @return void |
||
1218 | */ |
||
1219 | public static function allSame($value, $expect, $message = '') |
||
1223 | |||
1224 | /** |
||
1225 | * @psalm-pure |
||
1226 | * |
||
1227 | * @param mixed $value |
||
1228 | * @param mixed $expect |
||
1229 | * @param string $message |
||
1230 | * |
||
1231 | * @throws InvalidArgumentException |
||
1232 | * |
||
1233 | * @return void |
||
1234 | */ |
||
1235 | public static function nullOrNotSame($value, $expect, $message = '') |
||
1239 | |||
1240 | /** |
||
1241 | * @psalm-pure |
||
1242 | * |
||
1243 | * @param mixed $value |
||
1244 | * @param mixed $expect |
||
1245 | * @param string $message |
||
1246 | * |
||
1247 | * @throws InvalidArgumentException |
||
1248 | * |
||
1249 | * @return void |
||
1250 | */ |
||
1251 | public static function allNotSame($value, $expect, $message = '') |
||
1255 | |||
1256 | /** |
||
1257 | * @psalm-pure |
||
1258 | * |
||
1259 | * @param mixed $value |
||
1260 | * @param mixed $limit |
||
1261 | * @param string $message |
||
1262 | * |
||
1263 | * @throws InvalidArgumentException |
||
1264 | * |
||
1265 | * @return void |
||
1266 | */ |
||
1267 | public static function nullOrGreaterThan($value, $limit, $message = '') |
||
1271 | |||
1272 | /** |
||
1273 | * @psalm-pure |
||
1274 | * |
||
1275 | * @param mixed $value |
||
1276 | * @param mixed $limit |
||
1277 | * @param string $message |
||
1278 | * |
||
1279 | * @throws InvalidArgumentException |
||
1280 | * |
||
1281 | * @return void |
||
1282 | */ |
||
1283 | public static function allGreaterThan($value, $limit, $message = '') |
||
1287 | |||
1288 | /** |
||
1289 | * @psalm-pure |
||
1290 | * |
||
1291 | * @param mixed $value |
||
1292 | * @param mixed $limit |
||
1293 | * @param string $message |
||
1294 | * |
||
1295 | * @throws InvalidArgumentException |
||
1296 | * |
||
1297 | * @return void |
||
1298 | */ |
||
1299 | public static function nullOrGreaterThanEq($value, $limit, $message = '') |
||
1303 | |||
1304 | /** |
||
1305 | * @psalm-pure |
||
1306 | * |
||
1307 | * @param mixed $value |
||
1308 | * @param mixed $limit |
||
1309 | * @param string $message |
||
1310 | * |
||
1311 | * @throws InvalidArgumentException |
||
1312 | * |
||
1313 | * @return void |
||
1314 | */ |
||
1315 | public static function allGreaterThanEq($value, $limit, $message = '') |
||
1319 | |||
1320 | /** |
||
1321 | * @psalm-pure |
||
1322 | * |
||
1323 | * @param mixed $value |
||
1324 | * @param mixed $limit |
||
1325 | * @param string $message |
||
1326 | * |
||
1327 | * @throws InvalidArgumentException |
||
1328 | * |
||
1329 | * @return void |
||
1330 | */ |
||
1331 | public static function nullOrLessThan($value, $limit, $message = '') |
||
1335 | |||
1336 | /** |
||
1337 | * @psalm-pure |
||
1338 | * |
||
1339 | * @param mixed $value |
||
1340 | * @param mixed $limit |
||
1341 | * @param string $message |
||
1342 | * |
||
1343 | * @throws InvalidArgumentException |
||
1344 | * |
||
1345 | * @return void |
||
1346 | */ |
||
1347 | public static function allLessThan($value, $limit, $message = '') |
||
1351 | |||
1352 | /** |
||
1353 | * @psalm-pure |
||
1354 | * |
||
1355 | * @param mixed $value |
||
1356 | * @param mixed $limit |
||
1357 | * @param string $message |
||
1358 | * |
||
1359 | * @throws InvalidArgumentException |
||
1360 | * |
||
1361 | * @return void |
||
1362 | */ |
||
1363 | public static function nullOrLessThanEq($value, $limit, $message = '') |
||
1367 | |||
1368 | /** |
||
1369 | * @psalm-pure |
||
1370 | * |
||
1371 | * @param mixed $value |
||
1372 | * @param mixed $limit |
||
1373 | * @param string $message |
||
1374 | * |
||
1375 | * @throws InvalidArgumentException |
||
1376 | * |
||
1377 | * @return void |
||
1378 | */ |
||
1379 | public static function allLessThanEq($value, $limit, $message = '') |
||
1383 | |||
1384 | /** |
||
1385 | * @psalm-pure |
||
1386 | * |
||
1387 | * @param mixed $value |
||
1388 | * @param mixed $min |
||
1389 | * @param mixed $max |
||
1390 | * @param string $message |
||
1391 | * |
||
1392 | * @throws InvalidArgumentException |
||
1393 | * |
||
1394 | * @return void |
||
1395 | */ |
||
1396 | public static function nullOrRange($value, $min, $max, $message = '') |
||
1400 | |||
1401 | /** |
||
1402 | * @psalm-pure |
||
1403 | * |
||
1404 | * @param mixed $value |
||
1405 | * @param mixed $min |
||
1406 | * @param mixed $max |
||
1407 | * @param string $message |
||
1408 | * |
||
1409 | * @throws InvalidArgumentException |
||
1410 | * |
||
1411 | * @return void |
||
1412 | */ |
||
1413 | public static function allRange($value, $min, $max, $message = '') |
||
1417 | |||
1418 | /** |
||
1419 | * @psalm-pure |
||
1420 | * |
||
1421 | * @param mixed $value |
||
1422 | * @param array $values |
||
1423 | * @param string $message |
||
1424 | * |
||
1425 | * @throws InvalidArgumentException |
||
1426 | * |
||
1427 | * @return void |
||
1428 | */ |
||
1429 | public static function nullOrOneOf($value, $values, $message = '') |
||
1433 | |||
1434 | /** |
||
1435 | * @psalm-pure |
||
1436 | * |
||
1437 | * @param mixed $value |
||
1438 | * @param array $values |
||
1439 | * @param string $message |
||
1440 | * |
||
1441 | * @throws InvalidArgumentException |
||
1442 | * |
||
1443 | * @return void |
||
1444 | */ |
||
1445 | public static function allOneOf($value, $values, $message = '') |
||
1449 | |||
1450 | /** |
||
1451 | * @psalm-pure |
||
1452 | * |
||
1453 | * @param mixed $value |
||
1454 | * @param array $values |
||
1455 | * @param string $message |
||
1456 | * |
||
1457 | * @throws InvalidArgumentException |
||
1458 | * |
||
1459 | * @return void |
||
1460 | */ |
||
1461 | public static function nullOrInArray($value, $values, $message = '') |
||
1465 | |||
1466 | /** |
||
1467 | * @psalm-pure |
||
1468 | * |
||
1469 | * @param mixed $value |
||
1470 | * @param array $values |
||
1471 | * @param string $message |
||
1472 | * |
||
1473 | * @throws InvalidArgumentException |
||
1474 | * |
||
1475 | * @return void |
||
1476 | */ |
||
1477 | public static function allInArray($value, $values, $message = '') |
||
1481 | |||
1482 | /** |
||
1483 | * @psalm-pure |
||
1484 | * |
||
1485 | * @param string|null $value |
||
1486 | * @param string $subString |
||
1487 | * @param string $message |
||
1488 | * |
||
1489 | * @throws InvalidArgumentException |
||
1490 | * |
||
1491 | * @return void |
||
1492 | */ |
||
1493 | public static function nullOrContains($value, $subString, $message = '') |
||
1497 | |||
1498 | /** |
||
1499 | * @psalm-pure |
||
1500 | * |
||
1501 | * @param iterable<string> $value |
||
1502 | * @param string $subString |
||
1503 | * @param string $message |
||
1504 | * |
||
1505 | * @throws InvalidArgumentException |
||
1506 | * |
||
1507 | * @return void |
||
1508 | */ |
||
1509 | public static function allContains($value, $subString, $message = '') |
||
1513 | |||
1514 | /** |
||
1515 | * @psalm-pure |
||
1516 | * |
||
1517 | * @param string|null $value |
||
1518 | * @param string $subString |
||
1519 | * @param string $message |
||
1520 | * |
||
1521 | * @throws InvalidArgumentException |
||
1522 | * |
||
1523 | * @return void |
||
1524 | */ |
||
1525 | public static function nullOrNotContains($value, $subString, $message = '') |
||
1529 | |||
1530 | /** |
||
1531 | * @psalm-pure |
||
1532 | * |
||
1533 | * @param iterable<string> $value |
||
1534 | * @param string $subString |
||
1535 | * @param string $message |
||
1536 | * |
||
1537 | * @throws InvalidArgumentException |
||
1538 | * |
||
1539 | * @return void |
||
1540 | */ |
||
1541 | public static function allNotContains($value, $subString, $message = '') |
||
1545 | |||
1546 | /** |
||
1547 | * @psalm-pure |
||
1548 | * |
||
1549 | * @param string|null $value |
||
1550 | * @param string $message |
||
1551 | * |
||
1552 | * @throws InvalidArgumentException |
||
1553 | * |
||
1554 | * @return void |
||
1555 | */ |
||
1556 | public static function nullOrNotWhitespaceOnly($value, $message = '') |
||
1560 | |||
1561 | /** |
||
1562 | * @psalm-pure |
||
1563 | * |
||
1564 | * @param iterable<string> $value |
||
1565 | * @param string $message |
||
1566 | * |
||
1567 | * @throws InvalidArgumentException |
||
1568 | * |
||
1569 | * @return void |
||
1570 | */ |
||
1571 | public static function allNotWhitespaceOnly($value, $message = '') |
||
1575 | |||
1576 | /** |
||
1577 | * @psalm-pure |
||
1578 | * |
||
1579 | * @param string|null $value |
||
1580 | * @param string $prefix |
||
1581 | * @param string $message |
||
1582 | * |
||
1583 | * @throws InvalidArgumentException |
||
1584 | * |
||
1585 | * @return void |
||
1586 | */ |
||
1587 | public static function nullOrStartsWith($value, $prefix, $message = '') |
||
1591 | |||
1592 | /** |
||
1593 | * @psalm-pure |
||
1594 | * |
||
1595 | * @param iterable<string> $value |
||
1596 | * @param string $prefix |
||
1597 | * @param string $message |
||
1598 | * |
||
1599 | * @throws InvalidArgumentException |
||
1600 | * |
||
1601 | * @return void |
||
1602 | */ |
||
1603 | public static function allStartsWith($value, $prefix, $message = '') |
||
1607 | |||
1608 | /** |
||
1609 | * @psalm-pure |
||
1610 | * |
||
1611 | * @param string|null $value |
||
1612 | * @param string $prefix |
||
1613 | * @param string $message |
||
1614 | * |
||
1615 | * @throws InvalidArgumentException |
||
1616 | * |
||
1617 | * @return void |
||
1618 | */ |
||
1619 | public static function nullOrNotStartsWith($value, $prefix, $message = '') |
||
1623 | |||
1624 | /** |
||
1625 | * @psalm-pure |
||
1626 | * |
||
1627 | * @param iterable<string> $value |
||
1628 | * @param string $prefix |
||
1629 | * @param string $message |
||
1630 | * |
||
1631 | * @throws InvalidArgumentException |
||
1632 | * |
||
1633 | * @return void |
||
1634 | */ |
||
1635 | public static function allNotStartsWith($value, $prefix, $message = '') |
||
1639 | |||
1640 | /** |
||
1641 | * @psalm-pure |
||
1642 | * |
||
1643 | * @param mixed $value |
||
1644 | * @param string $message |
||
1645 | * |
||
1646 | * @throws InvalidArgumentException |
||
1647 | * |
||
1648 | * @return void |
||
1649 | */ |
||
1650 | public static function nullOrStartsWithLetter($value, $message = '') |
||
1654 | |||
1655 | /** |
||
1656 | * @psalm-pure |
||
1657 | * |
||
1658 | * @param mixed $value |
||
1659 | * @param string $message |
||
1660 | * |
||
1661 | * @throws InvalidArgumentException |
||
1662 | * |
||
1663 | * @return void |
||
1664 | */ |
||
1665 | public static function allStartsWithLetter($value, $message = '') |
||
1669 | |||
1670 | /** |
||
1671 | * @psalm-pure |
||
1672 | * |
||
1673 | * @param string|null $value |
||
1674 | * @param string $suffix |
||
1675 | * @param string $message |
||
1676 | * |
||
1677 | * @throws InvalidArgumentException |
||
1678 | * |
||
1679 | * @return void |
||
1680 | */ |
||
1681 | public static function nullOrEndsWith($value, $suffix, $message = '') |
||
1685 | |||
1686 | /** |
||
1687 | * @psalm-pure |
||
1688 | * |
||
1689 | * @param iterable<string> $value |
||
1690 | * @param string $suffix |
||
1691 | * @param string $message |
||
1692 | * |
||
1693 | * @throws InvalidArgumentException |
||
1694 | * |
||
1695 | * @return void |
||
1696 | */ |
||
1697 | public static function allEndsWith($value, $suffix, $message = '') |
||
1701 | |||
1702 | /** |
||
1703 | * @psalm-pure |
||
1704 | * |
||
1705 | * @param string|null $value |
||
1706 | * @param string $suffix |
||
1707 | * @param string $message |
||
1708 | * |
||
1709 | * @throws InvalidArgumentException |
||
1710 | * |
||
1711 | * @return void |
||
1712 | */ |
||
1713 | public static function nullOrNotEndsWith($value, $suffix, $message = '') |
||
1717 | |||
1718 | /** |
||
1719 | * @psalm-pure |
||
1720 | * |
||
1721 | * @param iterable<string> $value |
||
1722 | * @param string $suffix |
||
1723 | * @param string $message |
||
1724 | * |
||
1725 | * @throws InvalidArgumentException |
||
1726 | * |
||
1727 | * @return void |
||
1728 | */ |
||
1729 | public static function allNotEndsWith($value, $suffix, $message = '') |
||
1733 | |||
1734 | /** |
||
1735 | * @psalm-pure |
||
1736 | * |
||
1737 | * @param string|null $value |
||
1738 | * @param string $pattern |
||
1739 | * @param string $message |
||
1740 | * |
||
1741 | * @throws InvalidArgumentException |
||
1742 | * |
||
1743 | * @return void |
||
1744 | */ |
||
1745 | public static function nullOrRegex($value, $pattern, $message = '') |
||
1749 | |||
1750 | /** |
||
1751 | * @psalm-pure |
||
1752 | * |
||
1753 | * @param iterable<string> $value |
||
1754 | * @param string $pattern |
||
1755 | * @param string $message |
||
1756 | * |
||
1757 | * @throws InvalidArgumentException |
||
1758 | * |
||
1759 | * @return void |
||
1760 | */ |
||
1761 | public static function allRegex($value, $pattern, $message = '') |
||
1765 | |||
1766 | /** |
||
1767 | * @psalm-pure |
||
1768 | * |
||
1769 | * @param string|null $value |
||
1770 | * @param string $pattern |
||
1771 | * @param string $message |
||
1772 | * |
||
1773 | * @throws InvalidArgumentException |
||
1774 | * |
||
1775 | * @return void |
||
1776 | */ |
||
1777 | public static function nullOrNotRegex($value, $pattern, $message = '') |
||
1781 | |||
1782 | /** |
||
1783 | * @psalm-pure |
||
1784 | * |
||
1785 | * @param iterable<string> $value |
||
1786 | * @param string $pattern |
||
1787 | * @param string $message |
||
1788 | * |
||
1789 | * @throws InvalidArgumentException |
||
1790 | * |
||
1791 | * @return void |
||
1792 | */ |
||
1793 | public static function allNotRegex($value, $pattern, $message = '') |
||
1797 | |||
1798 | /** |
||
1799 | * @psalm-pure |
||
1800 | * |
||
1801 | * @param mixed $value |
||
1802 | * @param string $message |
||
1803 | * |
||
1804 | * @throws InvalidArgumentException |
||
1805 | * |
||
1806 | * @return void |
||
1807 | */ |
||
1808 | public static function nullOrUnicodeLetters($value, $message = '') |
||
1812 | |||
1813 | /** |
||
1814 | * @psalm-pure |
||
1815 | * |
||
1816 | * @param mixed $value |
||
1817 | * @param string $message |
||
1818 | * |
||
1819 | * @throws InvalidArgumentException |
||
1820 | * |
||
1821 | * @return void |
||
1822 | */ |
||
1823 | public static function allUnicodeLetters($value, $message = '') |
||
1827 | |||
1828 | /** |
||
1829 | * @psalm-pure |
||
1830 | * |
||
1831 | * @param mixed $value |
||
1832 | * @param string $message |
||
1833 | * |
||
1834 | * @throws InvalidArgumentException |
||
1835 | * |
||
1836 | * @return void |
||
1837 | */ |
||
1838 | public static function nullOrAlpha($value, $message = '') |
||
1842 | |||
1843 | /** |
||
1844 | * @psalm-pure |
||
1845 | * |
||
1846 | * @param mixed $value |
||
1847 | * @param string $message |
||
1848 | * |
||
1849 | * @throws InvalidArgumentException |
||
1850 | * |
||
1851 | * @return void |
||
1852 | */ |
||
1853 | public static function allAlpha($value, $message = '') |
||
1857 | |||
1858 | /** |
||
1859 | * @psalm-pure |
||
1860 | * |
||
1861 | * @param string|null $value |
||
1862 | * @param string $message |
||
1863 | * |
||
1864 | * @throws InvalidArgumentException |
||
1865 | * |
||
1866 | * @return void |
||
1867 | */ |
||
1868 | public static function nullOrDigits($value, $message = '') |
||
1872 | |||
1873 | /** |
||
1874 | * @psalm-pure |
||
1875 | * |
||
1876 | * @param iterable<string> $value |
||
1877 | * @param string $message |
||
1878 | * |
||
1879 | * @throws InvalidArgumentException |
||
1880 | * |
||
1881 | * @return void |
||
1882 | */ |
||
1883 | public static function allDigits($value, $message = '') |
||
1887 | |||
1888 | /** |
||
1889 | * @psalm-pure |
||
1890 | * |
||
1891 | * @param string|null $value |
||
1892 | * @param string $message |
||
1893 | * |
||
1894 | * @throws InvalidArgumentException |
||
1895 | * |
||
1896 | * @return void |
||
1897 | */ |
||
1898 | public static function nullOrAlnum($value, $message = '') |
||
1902 | |||
1903 | /** |
||
1904 | * @psalm-pure |
||
1905 | * |
||
1906 | * @param iterable<string> $value |
||
1907 | * @param string $message |
||
1908 | * |
||
1909 | * @throws InvalidArgumentException |
||
1910 | * |
||
1911 | * @return void |
||
1912 | */ |
||
1913 | public static function allAlnum($value, $message = '') |
||
1917 | |||
1918 | /** |
||
1919 | * @psalm-pure |
||
1920 | * @psalm-assert lowercase-string|null $value |
||
1921 | * |
||
1922 | * @param string|null $value |
||
1923 | * @param string $message |
||
1924 | * |
||
1925 | * @throws InvalidArgumentException |
||
1926 | * |
||
1927 | * @return void |
||
1928 | */ |
||
1929 | public static function nullOrLower($value, $message = '') |
||
1933 | |||
1934 | /** |
||
1935 | * @psalm-pure |
||
1936 | * @psalm-assert iterable<lowercase-string> $value |
||
1937 | * |
||
1938 | * @param iterable<string> $value |
||
1939 | * @param string $message |
||
1940 | * |
||
1941 | * @throws InvalidArgumentException |
||
1942 | * |
||
1943 | * @return void |
||
1944 | */ |
||
1945 | public static function allLower($value, $message = '') |
||
1949 | |||
1950 | /** |
||
1951 | * @psalm-pure |
||
1952 | * |
||
1953 | * @param string|null $value |
||
1954 | * @param string $message |
||
1955 | * |
||
1956 | * @throws InvalidArgumentException |
||
1957 | * |
||
1958 | * @return void |
||
1959 | */ |
||
1960 | public static function nullOrUpper($value, $message = '') |
||
1964 | |||
1965 | /** |
||
1966 | * @psalm-pure |
||
1967 | * |
||
1968 | * @param iterable<string> $value |
||
1969 | * @param string $message |
||
1970 | * |
||
1971 | * @throws InvalidArgumentException |
||
1972 | * |
||
1973 | * @return void |
||
1974 | */ |
||
1975 | public static function allUpper($value, $message = '') |
||
1979 | |||
1980 | /** |
||
1981 | * @psalm-pure |
||
1982 | * |
||
1983 | * @param string|null $value |
||
1984 | * @param int $length |
||
1985 | * @param string $message |
||
1986 | * |
||
1987 | * @throws InvalidArgumentException |
||
1988 | * |
||
1989 | * @return void |
||
1990 | */ |
||
1991 | public static function nullOrLength($value, $length, $message = '') |
||
1995 | |||
1996 | /** |
||
1997 | * @psalm-pure |
||
1998 | * |
||
1999 | * @param iterable<string> $value |
||
2000 | * @param int $length |
||
2001 | * @param string $message |
||
2002 | * |
||
2003 | * @throws InvalidArgumentException |
||
2004 | * |
||
2005 | * @return void |
||
2006 | */ |
||
2007 | public static function allLength($value, $length, $message = '') |
||
2011 | |||
2012 | /** |
||
2013 | * @psalm-pure |
||
2014 | * |
||
2015 | * @param string|null $value |
||
2016 | * @param int|float $min |
||
2017 | * @param string $message |
||
2018 | * |
||
2019 | * @throws InvalidArgumentException |
||
2020 | * |
||
2021 | * @return void |
||
2022 | */ |
||
2023 | public static function nullOrMinLength($value, $min, $message = '') |
||
2027 | |||
2028 | /** |
||
2029 | * @psalm-pure |
||
2030 | * |
||
2031 | * @param iterable<string> $value |
||
2032 | * @param int|float $min |
||
2033 | * @param string $message |
||
2034 | * |
||
2035 | * @throws InvalidArgumentException |
||
2036 | * |
||
2037 | * @return void |
||
2038 | */ |
||
2039 | public static function allMinLength($value, $min, $message = '') |
||
2043 | |||
2044 | /** |
||
2045 | * @psalm-pure |
||
2046 | * |
||
2047 | * @param string|null $value |
||
2048 | * @param int|float $max |
||
2049 | * @param string $message |
||
2050 | * |
||
2051 | * @throws InvalidArgumentException |
||
2052 | * |
||
2053 | * @return void |
||
2054 | */ |
||
2055 | public static function nullOrMaxLength($value, $max, $message = '') |
||
2059 | |||
2060 | /** |
||
2061 | * @psalm-pure |
||
2062 | * |
||
2063 | * @param iterable<string> $value |
||
2064 | * @param int|float $max |
||
2065 | * @param string $message |
||
2066 | * |
||
2067 | * @throws InvalidArgumentException |
||
2068 | * |
||
2069 | * @return void |
||
2070 | */ |
||
2071 | public static function allMaxLength($value, $max, $message = '') |
||
2075 | |||
2076 | /** |
||
2077 | * @psalm-pure |
||
2078 | * |
||
2079 | * @param string|null $value |
||
2080 | * @param int|float $min |
||
2081 | * @param int|float $max |
||
2082 | * @param string $message |
||
2083 | * |
||
2084 | * @throws InvalidArgumentException |
||
2085 | * |
||
2086 | * @return void |
||
2087 | */ |
||
2088 | public static function nullOrLengthBetween($value, $min, $max, $message = '') |
||
2092 | |||
2093 | /** |
||
2094 | * @psalm-pure |
||
2095 | * |
||
2096 | * @param iterable<string> $value |
||
2097 | * @param int|float $min |
||
2098 | * @param int|float $max |
||
2099 | * @param string $message |
||
2100 | * |
||
2101 | * @throws InvalidArgumentException |
||
2102 | * |
||
2103 | * @return void |
||
2104 | */ |
||
2105 | public static function allLengthBetween($value, $min, $max, $message = '') |
||
2109 | |||
2110 | /** |
||
2111 | * @param mixed $value |
||
2112 | * @param string $message |
||
2113 | * |
||
2114 | * @throws InvalidArgumentException |
||
2115 | * |
||
2116 | * @return void |
||
2117 | */ |
||
2118 | public static function nullOrFileExists($value, $message = '') |
||
2122 | |||
2123 | /** |
||
2124 | * @param mixed $value |
||
2125 | * @param string $message |
||
2126 | * |
||
2127 | * @throws InvalidArgumentException |
||
2128 | * |
||
2129 | * @return void |
||
2130 | */ |
||
2131 | public static function allFileExists($value, $message = '') |
||
2135 | |||
2136 | /** |
||
2137 | * @param mixed $value |
||
2138 | * @param string $message |
||
2139 | * |
||
2140 | * @throws InvalidArgumentException |
||
2141 | * |
||
2142 | * @return void |
||
2143 | */ |
||
2144 | public static function nullOrFile($value, $message = '') |
||
2148 | |||
2149 | /** |
||
2150 | * @param mixed $value |
||
2151 | * @param string $message |
||
2152 | * |
||
2153 | * @throws InvalidArgumentException |
||
2154 | * |
||
2155 | * @return void |
||
2156 | */ |
||
2157 | public static function allFile($value, $message = '') |
||
2161 | |||
2162 | /** |
||
2163 | * @param mixed $value |
||
2164 | * @param string $message |
||
2165 | * |
||
2166 | * @throws InvalidArgumentException |
||
2167 | * |
||
2168 | * @return void |
||
2169 | */ |
||
2170 | public static function nullOrDirectory($value, $message = '') |
||
2174 | |||
2175 | /** |
||
2176 | * @param mixed $value |
||
2177 | * @param string $message |
||
2178 | * |
||
2179 | * @throws InvalidArgumentException |
||
2180 | * |
||
2181 | * @return void |
||
2182 | */ |
||
2183 | public static function allDirectory($value, $message = '') |
||
2187 | |||
2188 | /** |
||
2189 | * @param string|null $value |
||
2190 | * @param string $message |
||
2191 | * |
||
2192 | * @throws InvalidArgumentException |
||
2193 | * |
||
2194 | * @return void |
||
2195 | */ |
||
2196 | public static function nullOrReadable($value, $message = '') |
||
2200 | |||
2201 | /** |
||
2202 | * @param iterable<string> $value |
||
2203 | * @param string $message |
||
2204 | * |
||
2205 | * @throws InvalidArgumentException |
||
2206 | * |
||
2207 | * @return void |
||
2208 | */ |
||
2209 | public static function allReadable($value, $message = '') |
||
2213 | |||
2214 | /** |
||
2215 | * @param string|null $value |
||
2216 | * @param string $message |
||
2217 | * |
||
2218 | * @throws InvalidArgumentException |
||
2219 | * |
||
2220 | * @return void |
||
2221 | */ |
||
2222 | public static function nullOrWritable($value, $message = '') |
||
2226 | |||
2227 | /** |
||
2228 | * @param iterable<string> $value |
||
2229 | * @param string $message |
||
2230 | * |
||
2231 | * @throws InvalidArgumentException |
||
2232 | * |
||
2233 | * @return void |
||
2234 | */ |
||
2235 | public static function allWritable($value, $message = '') |
||
2239 | |||
2240 | /** |
||
2241 | * @psalm-assert class-string|null $value |
||
2242 | * |
||
2243 | * @param mixed $value |
||
2244 | * @param string $message |
||
2245 | * |
||
2246 | * @throws InvalidArgumentException |
||
2247 | * |
||
2248 | * @return void |
||
2249 | */ |
||
2250 | public static function nullOrClassExists($value, $message = '') |
||
2254 | |||
2255 | /** |
||
2256 | * @psalm-assert iterable<class-string> $value |
||
2257 | * |
||
2258 | * @param mixed $value |
||
2259 | * @param string $message |
||
2260 | * |
||
2261 | * @throws InvalidArgumentException |
||
2262 | * |
||
2263 | * @return void |
||
2264 | */ |
||
2265 | public static function allClassExists($value, $message = '') |
||
2269 | |||
2270 | /** |
||
2271 | * @psalm-pure |
||
2272 | * @psalm-template ExpectedType of object |
||
2273 | * @psalm-param class-string<ExpectedType> $class |
||
2274 | * @psalm-assert class-string<ExpectedType>|ExpectedType|null $value |
||
2275 | * |
||
2276 | * @param mixed $value |
||
2277 | * @param string|object $class |
||
2278 | * @param string $message |
||
2279 | * |
||
2280 | * @throws InvalidArgumentException |
||
2281 | * |
||
2282 | * @return void |
||
2283 | */ |
||
2284 | public static function nullOrSubclassOf($value, $class, $message = '') |
||
2288 | |||
2289 | /** |
||
2290 | * @psalm-pure |
||
2291 | * @psalm-template ExpectedType of object |
||
2292 | * @psalm-param class-string<ExpectedType> $class |
||
2293 | * @psalm-assert iterable<class-string<ExpectedType>|ExpectedType> $value |
||
2294 | * |
||
2295 | * @param mixed $value |
||
2296 | * @param string|object $class |
||
2297 | * @param string $message |
||
2298 | * |
||
2299 | * @throws InvalidArgumentException |
||
2300 | * |
||
2301 | * @return void |
||
2302 | */ |
||
2303 | public static function allSubclassOf($value, $class, $message = '') |
||
2307 | |||
2308 | /** |
||
2309 | * @psalm-assert class-string|null $value |
||
2310 | * |
||
2311 | * @param mixed $value |
||
2312 | * @param string $message |
||
2313 | * |
||
2314 | * @throws InvalidArgumentException |
||
2315 | * |
||
2316 | * @return void |
||
2317 | */ |
||
2318 | public static function nullOrInterfaceExists($value, $message = '') |
||
2322 | |||
2323 | /** |
||
2324 | * @psalm-assert iterable<class-string> $value |
||
2325 | * |
||
2326 | * @param mixed $value |
||
2327 | * @param string $message |
||
2328 | * |
||
2329 | * @throws InvalidArgumentException |
||
2330 | * |
||
2331 | * @return void |
||
2332 | */ |
||
2333 | public static function allInterfaceExists($value, $message = '') |
||
2337 | |||
2338 | /** |
||
2339 | * @psalm-pure |
||
2340 | * @psalm-template ExpectedType of object |
||
2341 | * @psalm-param class-string<ExpectedType> $interface |
||
2342 | * @psalm-assert class-string<ExpectedType>|null $value |
||
2343 | * |
||
2344 | * @param mixed $value |
||
2345 | * @param mixed $interface |
||
2346 | * @param string $message |
||
2347 | * |
||
2348 | * @throws InvalidArgumentException |
||
2349 | * |
||
2350 | * @return void |
||
2351 | */ |
||
2352 | public static function nullOrImplementsInterface($value, $interface, $message = '') |
||
2356 | |||
2357 | /** |
||
2358 | * @psalm-pure |
||
2359 | * @psalm-template ExpectedType of object |
||
2360 | * @psalm-param class-string<ExpectedType> $interface |
||
2361 | * @psalm-assert iterable<class-string<ExpectedType>> $value |
||
2362 | * |
||
2363 | * @param mixed $value |
||
2364 | * @param mixed $interface |
||
2365 | * @param string $message |
||
2366 | * |
||
2367 | * @throws InvalidArgumentException |
||
2368 | * |
||
2369 | * @return void |
||
2370 | */ |
||
2371 | public static function allImplementsInterface($value, $interface, $message = '') |
||
2375 | |||
2376 | /** |
||
2377 | * @psalm-pure |
||
2378 | * @psalm-param class-string|object|null $classOrObject |
||
2379 | * |
||
2380 | * @param string|object|null $classOrObject |
||
2381 | * @param mixed $property |
||
2382 | * @param string $message |
||
2383 | * |
||
2384 | * @throws InvalidArgumentException |
||
2385 | * |
||
2386 | * @return void |
||
2387 | */ |
||
2388 | public static function nullOrPropertyExists($classOrObject, $property, $message = '') |
||
2392 | |||
2393 | /** |
||
2394 | * @psalm-pure |
||
2395 | * @psalm-param iterable<class-string|object> $classOrObject |
||
2396 | * |
||
2397 | * @param iterable<string|object> $classOrObject |
||
2398 | * @param mixed $property |
||
2399 | * @param string $message |
||
2400 | * |
||
2401 | * @throws InvalidArgumentException |
||
2402 | * |
||
2403 | * @return void |
||
2404 | */ |
||
2405 | public static function allPropertyExists($classOrObject, $property, $message = '') |
||
2409 | |||
2410 | /** |
||
2411 | * @psalm-pure |
||
2412 | * @psalm-param class-string|object|null $classOrObject |
||
2413 | * |
||
2414 | * @param string|object|null $classOrObject |
||
2415 | * @param mixed $property |
||
2416 | * @param string $message |
||
2417 | * |
||
2418 | * @throws InvalidArgumentException |
||
2419 | * |
||
2420 | * @return void |
||
2421 | */ |
||
2422 | public static function nullOrPropertyNotExists($classOrObject, $property, $message = '') |
||
2426 | |||
2427 | /** |
||
2428 | * @psalm-pure |
||
2429 | * @psalm-param iterable<class-string|object> $classOrObject |
||
2430 | * |
||
2431 | * @param iterable<string|object> $classOrObject |
||
2432 | * @param mixed $property |
||
2433 | * @param string $message |
||
2434 | * |
||
2435 | * @throws InvalidArgumentException |
||
2436 | * |
||
2437 | * @return void |
||
2438 | */ |
||
2439 | public static function allPropertyNotExists($classOrObject, $property, $message = '') |
||
2443 | |||
2444 | /** |
||
2445 | * @psalm-pure |
||
2446 | * @psalm-param class-string|object|null $classOrObject |
||
2447 | * |
||
2448 | * @param string|object|null $classOrObject |
||
2449 | * @param mixed $method |
||
2450 | * @param string $message |
||
2451 | * |
||
2452 | * @throws InvalidArgumentException |
||
2453 | * |
||
2454 | * @return void |
||
2455 | */ |
||
2456 | public static function nullOrMethodExists($classOrObject, $method, $message = '') |
||
2460 | |||
2461 | /** |
||
2462 | * @psalm-pure |
||
2463 | * @psalm-param iterable<class-string|object> $classOrObject |
||
2464 | * |
||
2465 | * @param iterable<string|object> $classOrObject |
||
2466 | * @param mixed $method |
||
2467 | * @param string $message |
||
2468 | * |
||
2469 | * @throws InvalidArgumentException |
||
2470 | * |
||
2471 | * @return void |
||
2472 | */ |
||
2473 | public static function allMethodExists($classOrObject, $method, $message = '') |
||
2477 | |||
2478 | /** |
||
2479 | * @psalm-pure |
||
2480 | * @psalm-param class-string|object|null $classOrObject |
||
2481 | * |
||
2482 | * @param string|object|null $classOrObject |
||
2483 | * @param mixed $method |
||
2484 | * @param string $message |
||
2485 | * |
||
2486 | * @throws InvalidArgumentException |
||
2487 | * |
||
2488 | * @return void |
||
2489 | */ |
||
2490 | public static function nullOrMethodNotExists($classOrObject, $method, $message = '') |
||
2494 | |||
2495 | /** |
||
2496 | * @psalm-pure |
||
2497 | * @psalm-param iterable<class-string|object> $classOrObject |
||
2498 | * |
||
2499 | * @param iterable<string|object> $classOrObject |
||
2500 | * @param mixed $method |
||
2501 | * @param string $message |
||
2502 | * |
||
2503 | * @throws InvalidArgumentException |
||
2504 | * |
||
2505 | * @return void |
||
2506 | */ |
||
2507 | public static function allMethodNotExists($classOrObject, $method, $message = '') |
||
2511 | |||
2512 | /** |
||
2513 | * @psalm-pure |
||
2514 | * |
||
2515 | * @param array|null $array |
||
2516 | * @param string|int $key |
||
2517 | * @param string $message |
||
2518 | * |
||
2519 | * @throws InvalidArgumentException |
||
2520 | * |
||
2521 | * @return void |
||
2522 | */ |
||
2523 | public static function nullOrKeyExists($array, $key, $message = '') |
||
2527 | |||
2528 | /** |
||
2529 | * @psalm-pure |
||
2530 | * |
||
2531 | * @param iterable<array> $array |
||
2532 | * @param string|int $key |
||
2533 | * @param string $message |
||
2534 | * |
||
2535 | * @throws InvalidArgumentException |
||
2536 | * |
||
2537 | * @return void |
||
2538 | */ |
||
2539 | public static function allKeyExists($array, $key, $message = '') |
||
2543 | |||
2544 | /** |
||
2545 | * @psalm-pure |
||
2546 | * |
||
2547 | * @param array|null $array |
||
2548 | * @param string|int $key |
||
2549 | * @param string $message |
||
2550 | * |
||
2551 | * @throws InvalidArgumentException |
||
2552 | * |
||
2553 | * @return void |
||
2554 | */ |
||
2555 | public static function nullOrKeyNotExists($array, $key, $message = '') |
||
2559 | |||
2560 | /** |
||
2561 | * @psalm-pure |
||
2562 | * |
||
2563 | * @param iterable<array> $array |
||
2564 | * @param string|int $key |
||
2565 | * @param string $message |
||
2566 | * |
||
2567 | * @throws InvalidArgumentException |
||
2568 | * |
||
2569 | * @return void |
||
2570 | */ |
||
2571 | public static function allKeyNotExists($array, $key, $message = '') |
||
2575 | |||
2576 | /** |
||
2577 | * @psalm-pure |
||
2578 | * @psalm-assert array-key|null $value |
||
2579 | * |
||
2580 | * @param mixed $value |
||
2581 | * @param string $message |
||
2582 | * |
||
2583 | * @throws InvalidArgumentException |
||
2584 | * |
||
2585 | * @return void |
||
2586 | */ |
||
2587 | public static function nullOrValidArrayKey($value, $message = '') |
||
2591 | |||
2592 | /** |
||
2593 | * @psalm-pure |
||
2594 | * @psalm-assert iterable<array-key> $value |
||
2595 | * |
||
2596 | * @param mixed $value |
||
2597 | * @param string $message |
||
2598 | * |
||
2599 | * @throws InvalidArgumentException |
||
2600 | * |
||
2601 | * @return void |
||
2602 | */ |
||
2603 | public static function allValidArrayKey($value, $message = '') |
||
2607 | |||
2608 | /** |
||
2609 | * @param Countable|array|null $array |
||
2610 | * @param int $number |
||
2611 | * @param string $message |
||
2612 | * |
||
2613 | * @throws InvalidArgumentException |
||
2614 | * |
||
2615 | * @return void |
||
2616 | */ |
||
2617 | public static function nullOrCount($array, $number, $message = '') |
||
2621 | |||
2622 | /** |
||
2623 | * @param iterable<Countable|array> $array |
||
2624 | * @param int $number |
||
2625 | * @param string $message |
||
2626 | * |
||
2627 | * @throws InvalidArgumentException |
||
2628 | * |
||
2629 | * @return void |
||
2630 | */ |
||
2631 | public static function allCount($array, $number, $message = '') |
||
2635 | |||
2636 | /** |
||
2637 | * @param Countable|array|null $array |
||
2638 | * @param int|float $min |
||
2639 | * @param string $message |
||
2640 | * |
||
2641 | * @throws InvalidArgumentException |
||
2642 | * |
||
2643 | * @return void |
||
2644 | */ |
||
2645 | public static function nullOrMinCount($array, $min, $message = '') |
||
2649 | |||
2650 | /** |
||
2651 | * @param iterable<Countable|array> $array |
||
2652 | * @param int|float $min |
||
2653 | * @param string $message |
||
2654 | * |
||
2655 | * @throws InvalidArgumentException |
||
2656 | * |
||
2657 | * @return void |
||
2658 | */ |
||
2659 | public static function allMinCount($array, $min, $message = '') |
||
2663 | |||
2664 | /** |
||
2665 | * @param Countable|array|null $array |
||
2666 | * @param int|float $max |
||
2667 | * @param string $message |
||
2668 | * |
||
2669 | * @throws InvalidArgumentException |
||
2670 | * |
||
2671 | * @return void |
||
2672 | */ |
||
2673 | public static function nullOrMaxCount($array, $max, $message = '') |
||
2677 | |||
2678 | /** |
||
2679 | * @param iterable<Countable|array> $array |
||
2680 | * @param int|float $max |
||
2681 | * @param string $message |
||
2682 | * |
||
2683 | * @throws InvalidArgumentException |
||
2684 | * |
||
2685 | * @return void |
||
2686 | */ |
||
2687 | public static function allMaxCount($array, $max, $message = '') |
||
2691 | |||
2692 | /** |
||
2693 | * @param Countable|array|null $array |
||
2694 | * @param int|float $min |
||
2695 | * @param int|float $max |
||
2696 | * @param string $message |
||
2697 | * |
||
2698 | * @throws InvalidArgumentException |
||
2699 | * |
||
2700 | * @return void |
||
2701 | */ |
||
2702 | public static function nullOrCountBetween($array, $min, $max, $message = '') |
||
2706 | |||
2707 | /** |
||
2708 | * @param iterable<Countable|array> $array |
||
2709 | * @param int|float $min |
||
2710 | * @param int|float $max |
||
2711 | * @param string $message |
||
2712 | * |
||
2713 | * @throws InvalidArgumentException |
||
2714 | * |
||
2715 | * @return void |
||
2716 | */ |
||
2717 | public static function allCountBetween($array, $min, $max, $message = '') |
||
2721 | |||
2722 | /** |
||
2723 | * @psalm-pure |
||
2724 | * @psalm-assert list|null $array |
||
2725 | * |
||
2726 | * @param mixed $array |
||
2727 | * @param string $message |
||
2728 | * |
||
2729 | * @throws InvalidArgumentException |
||
2730 | * |
||
2731 | * @return void |
||
2732 | */ |
||
2733 | public static function nullOrIsList($array, $message = '') |
||
2737 | |||
2738 | /** |
||
2739 | * @psalm-pure |
||
2740 | * @psalm-assert iterable<list> $array |
||
2741 | * |
||
2742 | * @param mixed $array |
||
2743 | * @param string $message |
||
2744 | * |
||
2745 | * @throws InvalidArgumentException |
||
2746 | * |
||
2747 | * @return void |
||
2748 | */ |
||
2749 | public static function allIsList($array, $message = '') |
||
2753 | |||
2754 | /** |
||
2755 | * @psalm-pure |
||
2756 | * @psalm-assert non-empty-list|null $array |
||
2757 | * |
||
2758 | * @param mixed $array |
||
2759 | * @param string $message |
||
2760 | * |
||
2761 | * @throws InvalidArgumentException |
||
2762 | * |
||
2763 | * @return void |
||
2764 | */ |
||
2765 | public static function nullOrIsNonEmptyList($array, $message = '') |
||
2769 | |||
2770 | /** |
||
2771 | * @psalm-pure |
||
2772 | * @psalm-assert iterable<non-empty-list> $array |
||
2773 | * |
||
2774 | * @param mixed $array |
||
2775 | * @param string $message |
||
2776 | * |
||
2777 | * @throws InvalidArgumentException |
||
2778 | * |
||
2779 | * @return void |
||
2780 | */ |
||
2781 | public static function allIsNonEmptyList($array, $message = '') |
||
2785 | |||
2786 | /** |
||
2787 | * @psalm-pure |
||
2788 | * @psalm-template T |
||
2789 | * @psalm-param mixed|array<T>|null $array |
||
2790 | * @psalm-assert array<string, T>|null $array |
||
2791 | * |
||
2792 | * @param mixed $array |
||
2793 | * @param string $message |
||
2794 | * |
||
2795 | * @throws InvalidArgumentException |
||
2796 | * |
||
2797 | * @return void |
||
2798 | */ |
||
2799 | public static function nullOrIsMap($array, $message = '') |
||
2803 | |||
2804 | /** |
||
2805 | * @psalm-pure |
||
2806 | * @psalm-template T |
||
2807 | * @psalm-param iterable<mixed|array<T>> $array |
||
2808 | * @psalm-assert iterable<array<string, T>> $array |
||
2809 | * |
||
2810 | * @param mixed $array |
||
2811 | * @param string $message |
||
2812 | * |
||
2813 | * @throws InvalidArgumentException |
||
2814 | * |
||
2815 | * @return void |
||
2816 | */ |
||
2817 | public static function allIsMap($array, $message = '') |
||
2821 | |||
2822 | /** |
||
2823 | * @psalm-pure |
||
2824 | * @psalm-template T |
||
2825 | * @psalm-param mixed|array<T>|null $array |
||
2826 | * |
||
2827 | * @param mixed $array |
||
2828 | * @param string $message |
||
2829 | * |
||
2830 | * @throws InvalidArgumentException |
||
2831 | * |
||
2832 | * @return void |
||
2833 | */ |
||
2834 | public static function nullOrIsNonEmptyMap($array, $message = '') |
||
2838 | |||
2839 | /** |
||
2840 | * @psalm-pure |
||
2841 | * @psalm-template T |
||
2842 | * @psalm-param iterable<mixed|array<T>> $array |
||
2843 | * |
||
2844 | * @param mixed $array |
||
2845 | * @param string $message |
||
2846 | * |
||
2847 | * @throws InvalidArgumentException |
||
2848 | * |
||
2849 | * @return void |
||
2850 | */ |
||
2851 | public static function allIsNonEmptyMap($array, $message = '') |
||
2855 | |||
2856 | /** |
||
2857 | * @psalm-pure |
||
2858 | * |
||
2859 | * @param string|null $value |
||
2860 | * @param string $message |
||
2861 | * |
||
2862 | * @throws InvalidArgumentException |
||
2863 | * |
||
2864 | * @return void |
||
2865 | */ |
||
2866 | public static function nullOrUuid($value, $message = '') |
||
2870 | |||
2871 | /** |
||
2872 | * @psalm-pure |
||
2873 | * |
||
2874 | * @param iterable<string> $value |
||
2875 | * @param string $message |
||
2876 | * |
||
2877 | * @throws InvalidArgumentException |
||
2878 | * |
||
2879 | * @return void |
||
2880 | */ |
||
2881 | public static function allUuid($value, $message = '') |
||
2885 | |||
2886 | /** |
||
2887 | * @psalm-param class-string<Throwable> $class |
||
2888 | * |
||
2889 | * @param Closure|null $expression |
||
2890 | * @param string $class |
||
2891 | * @param string $message |
||
2892 | * |
||
2893 | * @throws InvalidArgumentException |
||
2894 | * |
||
2895 | * @return void |
||
2896 | */ |
||
2897 | public static function nullOrThrows($expression, $class = 'Exception', $message = '') |
||
2901 | |||
2902 | /** |
||
2903 | * @psalm-param class-string<Throwable> $class |
||
2904 | * |
||
2905 | * @param iterable<Closure> $expression |
||
2906 | * @param string $class |
||
2907 | * @param string $message |
||
2908 | * |
||
2909 | * @throws InvalidArgumentException |
||
2910 | * |
||
2911 | * @return void |
||
2912 | */ |
||
2913 | public static function allThrows($expression, $class = 'Exception', $message = '') |
||
2917 | } |
||
2918 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.