Completed
Branch master (6bdf49)
by
unknown
36:31 queued 29:38
created
vendor/webmozart/assert/src/Assert.php 2 patches
Indentation   +2031 added lines, -2031 removed lines patch added patch discarded remove patch
@@ -32,2035 +32,2035 @@
 block discarded – undo
32 32
  */
33 33
 class Assert
34 34
 {
35
-    use Mixin;
36
-
37
-    /**
38
-     * @psalm-pure
39
-     * @psalm-assert string $value
40
-     *
41
-     * @param mixed  $value
42
-     * @param string $message
43
-     *
44
-     * @throws InvalidArgumentException
45
-     */
46
-    public static function string($value, $message = '')
47
-    {
48
-        if (!\is_string($value)) {
49
-            static::reportInvalidArgument(\sprintf(
50
-                $message ?: 'Expected a string. Got: %s',
51
-                static::typeToString($value)
52
-            ));
53
-        }
54
-    }
55
-
56
-    /**
57
-     * @psalm-pure
58
-     * @psalm-assert non-empty-string $value
59
-     *
60
-     * @param mixed  $value
61
-     * @param string $message
62
-     *
63
-     * @throws InvalidArgumentException
64
-     */
65
-    public static function stringNotEmpty($value, $message = '')
66
-    {
67
-        static::string($value, $message);
68
-        static::notEq($value, '', $message);
69
-    }
70
-
71
-    /**
72
-     * @psalm-pure
73
-     * @psalm-assert int $value
74
-     *
75
-     * @param mixed  $value
76
-     * @param string $message
77
-     *
78
-     * @throws InvalidArgumentException
79
-     */
80
-    public static function integer($value, $message = '')
81
-    {
82
-        if (!\is_int($value)) {
83
-            static::reportInvalidArgument(\sprintf(
84
-                $message ?: 'Expected an integer. Got: %s',
85
-                static::typeToString($value)
86
-            ));
87
-        }
88
-    }
89
-
90
-    /**
91
-     * @psalm-pure
92
-     * @psalm-assert numeric $value
93
-     *
94
-     * @param mixed  $value
95
-     * @param string $message
96
-     *
97
-     * @throws InvalidArgumentException
98
-     */
99
-    public static function integerish($value, $message = '')
100
-    {
101
-        if (!\is_numeric($value) || $value != (int) $value) {
102
-            static::reportInvalidArgument(\sprintf(
103
-                $message ?: 'Expected an integerish value. Got: %s',
104
-                static::typeToString($value)
105
-            ));
106
-        }
107
-    }
108
-
109
-    /**
110
-     * @psalm-pure
111
-     * @psalm-assert positive-int $value
112
-     *
113
-     * @param mixed  $value
114
-     * @param string $message
115
-     *
116
-     * @throws InvalidArgumentException
117
-     */
118
-    public static function positiveInteger($value, $message = '')
119
-    {
120
-        if (!(\is_int($value) && $value > 0)) {
121
-            static::reportInvalidArgument(\sprintf(
122
-                $message ?: 'Expected a positive integer. Got: %s',
123
-                static::valueToString($value)
124
-            ));
125
-        }
126
-    }
127
-
128
-    /**
129
-     * @psalm-pure
130
-     * @psalm-assert float $value
131
-     *
132
-     * @param mixed  $value
133
-     * @param string $message
134
-     *
135
-     * @throws InvalidArgumentException
136
-     */
137
-    public static function float($value, $message = '')
138
-    {
139
-        if (!\is_float($value)) {
140
-            static::reportInvalidArgument(\sprintf(
141
-                $message ?: 'Expected a float. Got: %s',
142
-                static::typeToString($value)
143
-            ));
144
-        }
145
-    }
146
-
147
-    /**
148
-     * @psalm-pure
149
-     * @psalm-assert numeric $value
150
-     *
151
-     * @param mixed  $value
152
-     * @param string $message
153
-     *
154
-     * @throws InvalidArgumentException
155
-     */
156
-    public static function numeric($value, $message = '')
157
-    {
158
-        if (!\is_numeric($value)) {
159
-            static::reportInvalidArgument(\sprintf(
160
-                $message ?: 'Expected a numeric. Got: %s',
161
-                static::typeToString($value)
162
-            ));
163
-        }
164
-    }
165
-
166
-    /**
167
-     * @psalm-pure
168
-     * @psalm-assert positive-int|0 $value
169
-     *
170
-     * @param mixed  $value
171
-     * @param string $message
172
-     *
173
-     * @throws InvalidArgumentException
174
-     */
175
-    public static function natural($value, $message = '')
176
-    {
177
-        if (!\is_int($value) || $value < 0) {
178
-            static::reportInvalidArgument(\sprintf(
179
-                $message ?: 'Expected a non-negative integer. Got: %s',
180
-                static::valueToString($value)
181
-            ));
182
-        }
183
-    }
184
-
185
-    /**
186
-     * @psalm-pure
187
-     * @psalm-assert bool $value
188
-     *
189
-     * @param mixed  $value
190
-     * @param string $message
191
-     *
192
-     * @throws InvalidArgumentException
193
-     */
194
-    public static function boolean($value, $message = '')
195
-    {
196
-        if (!\is_bool($value)) {
197
-            static::reportInvalidArgument(\sprintf(
198
-                $message ?: 'Expected a boolean. Got: %s',
199
-                static::typeToString($value)
200
-            ));
201
-        }
202
-    }
203
-
204
-    /**
205
-     * @psalm-pure
206
-     * @psalm-assert scalar $value
207
-     *
208
-     * @param mixed  $value
209
-     * @param string $message
210
-     *
211
-     * @throws InvalidArgumentException
212
-     */
213
-    public static function scalar($value, $message = '')
214
-    {
215
-        if (!\is_scalar($value)) {
216
-            static::reportInvalidArgument(\sprintf(
217
-                $message ?: 'Expected a scalar. Got: %s',
218
-                static::typeToString($value)
219
-            ));
220
-        }
221
-    }
222
-
223
-    /**
224
-     * @psalm-pure
225
-     * @psalm-assert object $value
226
-     *
227
-     * @param mixed  $value
228
-     * @param string $message
229
-     *
230
-     * @throws InvalidArgumentException
231
-     */
232
-    public static function object($value, $message = '')
233
-    {
234
-        if (!\is_object($value)) {
235
-            static::reportInvalidArgument(\sprintf(
236
-                $message ?: 'Expected an object. Got: %s',
237
-                static::typeToString($value)
238
-            ));
239
-        }
240
-    }
241
-
242
-    /**
243
-     * @psalm-pure
244
-     * @psalm-assert resource $value
245
-     *
246
-     * @param mixed       $value
247
-     * @param string|null $type    type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php
248
-     * @param string      $message
249
-     *
250
-     * @throws InvalidArgumentException
251
-     */
252
-    public static function resource($value, $type = null, $message = '')
253
-    {
254
-        if (!\is_resource($value)) {
255
-            static::reportInvalidArgument(\sprintf(
256
-                $message ?: 'Expected a resource. Got: %s',
257
-                static::typeToString($value)
258
-            ));
259
-        }
260
-
261
-        if ($type && $type !== \get_resource_type($value)) {
262
-            static::reportInvalidArgument(\sprintf(
263
-                $message ?: 'Expected a resource of type %2$s. Got: %s',
264
-                static::typeToString($value),
265
-                $type
266
-            ));
267
-        }
268
-    }
269
-
270
-    /**
271
-     * @psalm-pure
272
-     * @psalm-assert callable $value
273
-     *
274
-     * @param mixed  $value
275
-     * @param string $message
276
-     *
277
-     * @throws InvalidArgumentException
278
-     */
279
-    public static function isCallable($value, $message = '')
280
-    {
281
-        if (!\is_callable($value)) {
282
-            static::reportInvalidArgument(\sprintf(
283
-                $message ?: 'Expected a callable. Got: %s',
284
-                static::typeToString($value)
285
-            ));
286
-        }
287
-    }
288
-
289
-    /**
290
-     * @psalm-pure
291
-     * @psalm-assert array $value
292
-     *
293
-     * @param mixed  $value
294
-     * @param string $message
295
-     *
296
-     * @throws InvalidArgumentException
297
-     */
298
-    public static function isArray($value, $message = '')
299
-    {
300
-        if (!\is_array($value)) {
301
-            static::reportInvalidArgument(\sprintf(
302
-                $message ?: 'Expected an array. Got: %s',
303
-                static::typeToString($value)
304
-            ));
305
-        }
306
-    }
307
-
308
-    /**
309
-     * @psalm-pure
310
-     * @psalm-assert iterable $value
311
-     *
312
-     * @deprecated use "isIterable" or "isInstanceOf" instead
313
-     *
314
-     * @param mixed  $value
315
-     * @param string $message
316
-     *
317
-     * @throws InvalidArgumentException
318
-     */
319
-    public static function isTraversable($value, $message = '')
320
-    {
321
-        @\trigger_error(
322
-            \sprintf(
323
-                'The "%s" assertion is deprecated. You should stop using it, as it will soon be removed in 2.0 version. Use "isIterable" or "isInstanceOf" instead.',
324
-                __METHOD__
325
-            ),
326
-            \E_USER_DEPRECATED
327
-        );
328
-
329
-        if (!\is_array($value) && !($value instanceof Traversable)) {
330
-            static::reportInvalidArgument(\sprintf(
331
-                $message ?: 'Expected a traversable. Got: %s',
332
-                static::typeToString($value)
333
-            ));
334
-        }
335
-    }
336
-
337
-    /**
338
-     * @psalm-pure
339
-     * @psalm-assert array|ArrayAccess $value
340
-     *
341
-     * @param mixed  $value
342
-     * @param string $message
343
-     *
344
-     * @throws InvalidArgumentException
345
-     */
346
-    public static function isArrayAccessible($value, $message = '')
347
-    {
348
-        if (!\is_array($value) && !($value instanceof ArrayAccess)) {
349
-            static::reportInvalidArgument(\sprintf(
350
-                $message ?: 'Expected an array accessible. Got: %s',
351
-                static::typeToString($value)
352
-            ));
353
-        }
354
-    }
355
-
356
-    /**
357
-     * @psalm-pure
358
-     * @psalm-assert countable $value
359
-     *
360
-     * @param mixed  $value
361
-     * @param string $message
362
-     *
363
-     * @throws InvalidArgumentException
364
-     */
365
-    public static function isCountable($value, $message = '')
366
-    {
367
-        if (
368
-            !\is_array($value)
369
-            && !($value instanceof Countable)
370
-            && !($value instanceof ResourceBundle)
371
-            && !($value instanceof SimpleXMLElement)
372
-        ) {
373
-            static::reportInvalidArgument(\sprintf(
374
-                $message ?: 'Expected a countable. Got: %s',
375
-                static::typeToString($value)
376
-            ));
377
-        }
378
-    }
379
-
380
-    /**
381
-     * @psalm-pure
382
-     * @psalm-assert iterable $value
383
-     *
384
-     * @param mixed  $value
385
-     * @param string $message
386
-     *
387
-     * @throws InvalidArgumentException
388
-     */
389
-    public static function isIterable($value, $message = '')
390
-    {
391
-        if (!\is_array($value) && !($value instanceof Traversable)) {
392
-            static::reportInvalidArgument(\sprintf(
393
-                $message ?: 'Expected an iterable. Got: %s',
394
-                static::typeToString($value)
395
-            ));
396
-        }
397
-    }
398
-
399
-    /**
400
-     * @psalm-pure
401
-     * @psalm-template ExpectedType of object
402
-     * @psalm-param class-string<ExpectedType> $class
403
-     * @psalm-assert ExpectedType $value
404
-     *
405
-     * @param mixed         $value
406
-     * @param string|object $class
407
-     * @param string        $message
408
-     *
409
-     * @throws InvalidArgumentException
410
-     */
411
-    public static function isInstanceOf($value, $class, $message = '')
412
-    {
413
-        if (!($value instanceof $class)) {
414
-            static::reportInvalidArgument(\sprintf(
415
-                $message ?: 'Expected an instance of %2$s. Got: %s',
416
-                static::typeToString($value),
417
-                $class
418
-            ));
419
-        }
420
-    }
421
-
422
-    /**
423
-     * @psalm-pure
424
-     * @psalm-template ExpectedType of object
425
-     * @psalm-param class-string<ExpectedType> $class
426
-     * @psalm-assert !ExpectedType $value
427
-     *
428
-     * @param mixed         $value
429
-     * @param string|object $class
430
-     * @param string        $message
431
-     *
432
-     * @throws InvalidArgumentException
433
-     */
434
-    public static function notInstanceOf($value, $class, $message = '')
435
-    {
436
-        if ($value instanceof $class) {
437
-            static::reportInvalidArgument(\sprintf(
438
-                $message ?: 'Expected an instance other than %2$s. Got: %s',
439
-                static::typeToString($value),
440
-                $class
441
-            ));
442
-        }
443
-    }
444
-
445
-    /**
446
-     * @psalm-pure
447
-     * @psalm-param array<class-string> $classes
448
-     *
449
-     * @param mixed                $value
450
-     * @param array<object|string> $classes
451
-     * @param string               $message
452
-     *
453
-     * @throws InvalidArgumentException
454
-     */
455
-    public static function isInstanceOfAny($value, array $classes, $message = '')
456
-    {
457
-        foreach ($classes as $class) {
458
-            if ($value instanceof $class) {
459
-                return;
460
-            }
461
-        }
462
-
463
-        static::reportInvalidArgument(\sprintf(
464
-            $message ?: 'Expected an instance of any of %2$s. Got: %s',
465
-            static::typeToString($value),
466
-            \implode(', ', \array_map(array('static', 'valueToString'), $classes))
467
-        ));
468
-    }
469
-
470
-    /**
471
-     * @psalm-pure
472
-     * @psalm-template ExpectedType of object
473
-     * @psalm-param class-string<ExpectedType> $class
474
-     * @psalm-assert ExpectedType|class-string<ExpectedType> $value
475
-     *
476
-     * @param object|string $value
477
-     * @param string        $class
478
-     * @param string        $message
479
-     *
480
-     * @throws InvalidArgumentException
481
-     */
482
-    public static function isAOf($value, $class, $message = '')
483
-    {
484
-        static::string($class, 'Expected class as a string. Got: %s');
485
-
486
-        if (!\is_a($value, $class, \is_string($value))) {
487
-            static::reportInvalidArgument(sprintf(
488
-                $message ?: 'Expected an instance of this class or to this class among his parents %2$s. Got: %s',
489
-                static::typeToString($value),
490
-                $class
491
-            ));
492
-        }
493
-    }
494
-
495
-    /**
496
-     * @psalm-pure
497
-     * @psalm-template UnexpectedType of object
498
-     * @psalm-param class-string<UnexpectedType> $class
499
-     * @psalm-assert !UnexpectedType $value
500
-     * @psalm-assert !class-string<UnexpectedType> $value
501
-     *
502
-     * @param object|string $value
503
-     * @param string        $class
504
-     * @param string        $message
505
-     *
506
-     * @throws InvalidArgumentException
507
-     */
508
-    public static function isNotA($value, $class, $message = '')
509
-    {
510
-        static::string($class, 'Expected class as a string. Got: %s');
511
-
512
-        if (\is_a($value, $class, \is_string($value))) {
513
-            static::reportInvalidArgument(sprintf(
514
-                $message ?: 'Expected an instance of this class or to this class among his parents other than %2$s. Got: %s',
515
-                static::typeToString($value),
516
-                $class
517
-            ));
518
-        }
519
-    }
520
-
521
-    /**
522
-     * @psalm-pure
523
-     * @psalm-param array<class-string> $classes
524
-     *
525
-     * @param object|string $value
526
-     * @param string[]      $classes
527
-     * @param string        $message
528
-     *
529
-     * @throws InvalidArgumentException
530
-     */
531
-    public static function isAnyOf($value, array $classes, $message = '')
532
-    {
533
-        foreach ($classes as $class) {
534
-            static::string($class, 'Expected class as a string. Got: %s');
535
-
536
-            if (\is_a($value, $class, \is_string($value))) {
537
-                return;
538
-            }
539
-        }
540
-
541
-        static::reportInvalidArgument(sprintf(
542
-            $message ?: 'Expected an any of instance of this class or to this class among his parents other than %2$s. Got: %s',
543
-            static::typeToString($value),
544
-            \implode(', ', \array_map(array('static', 'valueToString'), $classes))
545
-        ));
546
-    }
547
-
548
-    /**
549
-     * @psalm-pure
550
-     * @psalm-assert empty $value
551
-     *
552
-     * @param mixed  $value
553
-     * @param string $message
554
-     *
555
-     * @throws InvalidArgumentException
556
-     */
557
-    public static function isEmpty($value, $message = '')
558
-    {
559
-        if (!empty($value)) {
560
-            static::reportInvalidArgument(\sprintf(
561
-                $message ?: 'Expected an empty value. Got: %s',
562
-                static::valueToString($value)
563
-            ));
564
-        }
565
-    }
566
-
567
-    /**
568
-     * @psalm-pure
569
-     * @psalm-assert !empty $value
570
-     *
571
-     * @param mixed  $value
572
-     * @param string $message
573
-     *
574
-     * @throws InvalidArgumentException
575
-     */
576
-    public static function notEmpty($value, $message = '')
577
-    {
578
-        if (empty($value)) {
579
-            static::reportInvalidArgument(\sprintf(
580
-                $message ?: 'Expected a non-empty value. Got: %s',
581
-                static::valueToString($value)
582
-            ));
583
-        }
584
-    }
585
-
586
-    /**
587
-     * @psalm-pure
588
-     * @psalm-assert null $value
589
-     *
590
-     * @param mixed  $value
591
-     * @param string $message
592
-     *
593
-     * @throws InvalidArgumentException
594
-     */
595
-    public static function null($value, $message = '')
596
-    {
597
-        if (null !== $value) {
598
-            static::reportInvalidArgument(\sprintf(
599
-                $message ?: 'Expected null. Got: %s',
600
-                static::valueToString($value)
601
-            ));
602
-        }
603
-    }
604
-
605
-    /**
606
-     * @psalm-pure
607
-     * @psalm-assert !null $value
608
-     *
609
-     * @param mixed  $value
610
-     * @param string $message
611
-     *
612
-     * @throws InvalidArgumentException
613
-     */
614
-    public static function notNull($value, $message = '')
615
-    {
616
-        if (null === $value) {
617
-            static::reportInvalidArgument(
618
-                $message ?: 'Expected a value other than null.'
619
-            );
620
-        }
621
-    }
622
-
623
-    /**
624
-     * @psalm-pure
625
-     * @psalm-assert true $value
626
-     *
627
-     * @param mixed  $value
628
-     * @param string $message
629
-     *
630
-     * @throws InvalidArgumentException
631
-     */
632
-    public static function true($value, $message = '')
633
-    {
634
-        if (true !== $value) {
635
-            static::reportInvalidArgument(\sprintf(
636
-                $message ?: 'Expected a value to be true. Got: %s',
637
-                static::valueToString($value)
638
-            ));
639
-        }
640
-    }
641
-
642
-    /**
643
-     * @psalm-pure
644
-     * @psalm-assert false $value
645
-     *
646
-     * @param mixed  $value
647
-     * @param string $message
648
-     *
649
-     * @throws InvalidArgumentException
650
-     */
651
-    public static function false($value, $message = '')
652
-    {
653
-        if (false !== $value) {
654
-            static::reportInvalidArgument(\sprintf(
655
-                $message ?: 'Expected a value to be false. Got: %s',
656
-                static::valueToString($value)
657
-            ));
658
-        }
659
-    }
660
-
661
-    /**
662
-     * @psalm-pure
663
-     * @psalm-assert !false $value
664
-     *
665
-     * @param mixed  $value
666
-     * @param string $message
667
-     *
668
-     * @throws InvalidArgumentException
669
-     */
670
-    public static function notFalse($value, $message = '')
671
-    {
672
-        if (false === $value) {
673
-            static::reportInvalidArgument(
674
-                $message ?: 'Expected a value other than false.'
675
-            );
676
-        }
677
-    }
678
-
679
-    /**
680
-     * @param mixed  $value
681
-     * @param string $message
682
-     *
683
-     * @throws InvalidArgumentException
684
-     */
685
-    public static function ip($value, $message = '')
686
-    {
687
-        if (false === \filter_var($value, \FILTER_VALIDATE_IP)) {
688
-            static::reportInvalidArgument(\sprintf(
689
-                $message ?: 'Expected a value to be an IP. Got: %s',
690
-                static::valueToString($value)
691
-            ));
692
-        }
693
-    }
694
-
695
-    /**
696
-     * @param mixed  $value
697
-     * @param string $message
698
-     *
699
-     * @throws InvalidArgumentException
700
-     */
701
-    public static function ipv4($value, $message = '')
702
-    {
703
-        if (false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4)) {
704
-            static::reportInvalidArgument(\sprintf(
705
-                $message ?: 'Expected a value to be an IPv4. Got: %s',
706
-                static::valueToString($value)
707
-            ));
708
-        }
709
-    }
710
-
711
-    /**
712
-     * @param mixed  $value
713
-     * @param string $message
714
-     *
715
-     * @throws InvalidArgumentException
716
-     */
717
-    public static function ipv6($value, $message = '')
718
-    {
719
-        if (false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) {
720
-            static::reportInvalidArgument(\sprintf(
721
-                $message ?: 'Expected a value to be an IPv6. Got: %s',
722
-                static::valueToString($value)
723
-            ));
724
-        }
725
-    }
726
-
727
-    /**
728
-     * @param mixed  $value
729
-     * @param string $message
730
-     *
731
-     * @throws InvalidArgumentException
732
-     */
733
-    public static function email($value, $message = '')
734
-    {
735
-        if (false === \filter_var($value, FILTER_VALIDATE_EMAIL)) {
736
-            static::reportInvalidArgument(\sprintf(
737
-                $message ?: 'Expected a value to be a valid e-mail address. Got: %s',
738
-                static::valueToString($value)
739
-            ));
740
-        }
741
-    }
742
-
743
-    /**
744
-     * Does non strict comparisons on the items, so ['3', 3] will not pass the assertion.
745
-     *
746
-     * @param array  $values
747
-     * @param string $message
748
-     *
749
-     * @throws InvalidArgumentException
750
-     */
751
-    public static function uniqueValues(array $values, $message = '')
752
-    {
753
-        $allValues = \count($values);
754
-        $uniqueValues = \count(\array_unique($values));
755
-
756
-        if ($allValues !== $uniqueValues) {
757
-            $difference = $allValues - $uniqueValues;
758
-
759
-            static::reportInvalidArgument(\sprintf(
760
-                $message ?: 'Expected an array of unique values, but %s of them %s duplicated',
761
-                $difference,
762
-                (1 === $difference ? 'is' : 'are')
763
-            ));
764
-        }
765
-    }
766
-
767
-    /**
768
-     * @param mixed  $value
769
-     * @param mixed  $expect
770
-     * @param string $message
771
-     *
772
-     * @throws InvalidArgumentException
773
-     */
774
-    public static function eq($value, $expect, $message = '')
775
-    {
776
-        if ($expect != $value) {
777
-            static::reportInvalidArgument(\sprintf(
778
-                $message ?: 'Expected a value equal to %2$s. Got: %s',
779
-                static::valueToString($value),
780
-                static::valueToString($expect)
781
-            ));
782
-        }
783
-    }
784
-
785
-    /**
786
-     * @param mixed  $value
787
-     * @param mixed  $expect
788
-     * @param string $message
789
-     *
790
-     * @throws InvalidArgumentException
791
-     */
792
-    public static function notEq($value, $expect, $message = '')
793
-    {
794
-        if ($expect == $value) {
795
-            static::reportInvalidArgument(\sprintf(
796
-                $message ?: 'Expected a different value than %s.',
797
-                static::valueToString($expect)
798
-            ));
799
-        }
800
-    }
801
-
802
-    /**
803
-     * @psalm-pure
804
-     *
805
-     * @param mixed  $value
806
-     * @param mixed  $expect
807
-     * @param string $message
808
-     *
809
-     * @throws InvalidArgumentException
810
-     */
811
-    public static function same($value, $expect, $message = '')
812
-    {
813
-        if ($expect !== $value) {
814
-            static::reportInvalidArgument(\sprintf(
815
-                $message ?: 'Expected a value identical to %2$s. Got: %s',
816
-                static::valueToString($value),
817
-                static::valueToString($expect)
818
-            ));
819
-        }
820
-    }
821
-
822
-    /**
823
-     * @psalm-pure
824
-     *
825
-     * @param mixed  $value
826
-     * @param mixed  $expect
827
-     * @param string $message
828
-     *
829
-     * @throws InvalidArgumentException
830
-     */
831
-    public static function notSame($value, $expect, $message = '')
832
-    {
833
-        if ($expect === $value) {
834
-            static::reportInvalidArgument(\sprintf(
835
-                $message ?: 'Expected a value not identical to %s.',
836
-                static::valueToString($expect)
837
-            ));
838
-        }
839
-    }
840
-
841
-    /**
842
-     * @psalm-pure
843
-     *
844
-     * @param mixed  $value
845
-     * @param mixed  $limit
846
-     * @param string $message
847
-     *
848
-     * @throws InvalidArgumentException
849
-     */
850
-    public static function greaterThan($value, $limit, $message = '')
851
-    {
852
-        if ($value <= $limit) {
853
-            static::reportInvalidArgument(\sprintf(
854
-                $message ?: 'Expected a value greater than %2$s. Got: %s',
855
-                static::valueToString($value),
856
-                static::valueToString($limit)
857
-            ));
858
-        }
859
-    }
860
-
861
-    /**
862
-     * @psalm-pure
863
-     *
864
-     * @param mixed  $value
865
-     * @param mixed  $limit
866
-     * @param string $message
867
-     *
868
-     * @throws InvalidArgumentException
869
-     */
870
-    public static function greaterThanEq($value, $limit, $message = '')
871
-    {
872
-        if ($value < $limit) {
873
-            static::reportInvalidArgument(\sprintf(
874
-                $message ?: 'Expected a value greater than or equal to %2$s. Got: %s',
875
-                static::valueToString($value),
876
-                static::valueToString($limit)
877
-            ));
878
-        }
879
-    }
880
-
881
-    /**
882
-     * @psalm-pure
883
-     *
884
-     * @param mixed  $value
885
-     * @param mixed  $limit
886
-     * @param string $message
887
-     *
888
-     * @throws InvalidArgumentException
889
-     */
890
-    public static function lessThan($value, $limit, $message = '')
891
-    {
892
-        if ($value >= $limit) {
893
-            static::reportInvalidArgument(\sprintf(
894
-                $message ?: 'Expected a value less than %2$s. Got: %s',
895
-                static::valueToString($value),
896
-                static::valueToString($limit)
897
-            ));
898
-        }
899
-    }
900
-
901
-    /**
902
-     * @psalm-pure
903
-     *
904
-     * @param mixed  $value
905
-     * @param mixed  $limit
906
-     * @param string $message
907
-     *
908
-     * @throws InvalidArgumentException
909
-     */
910
-    public static function lessThanEq($value, $limit, $message = '')
911
-    {
912
-        if ($value > $limit) {
913
-            static::reportInvalidArgument(\sprintf(
914
-                $message ?: 'Expected a value less than or equal to %2$s. Got: %s',
915
-                static::valueToString($value),
916
-                static::valueToString($limit)
917
-            ));
918
-        }
919
-    }
920
-
921
-    /**
922
-     * Inclusive range, so Assert::(3, 3, 5) passes.
923
-     *
924
-     * @psalm-pure
925
-     *
926
-     * @param mixed  $value
927
-     * @param mixed  $min
928
-     * @param mixed  $max
929
-     * @param string $message
930
-     *
931
-     * @throws InvalidArgumentException
932
-     */
933
-    public static function range($value, $min, $max, $message = '')
934
-    {
935
-        if ($value < $min || $value > $max) {
936
-            static::reportInvalidArgument(\sprintf(
937
-                $message ?: 'Expected a value between %2$s and %3$s. Got: %s',
938
-                static::valueToString($value),
939
-                static::valueToString($min),
940
-                static::valueToString($max)
941
-            ));
942
-        }
943
-    }
944
-
945
-    /**
946
-     * A more human-readable alias of Assert::inArray().
947
-     *
948
-     * @psalm-pure
949
-     *
950
-     * @param mixed  $value
951
-     * @param array  $values
952
-     * @param string $message
953
-     *
954
-     * @throws InvalidArgumentException
955
-     */
956
-    public static function oneOf($value, array $values, $message = '')
957
-    {
958
-        static::inArray($value, $values, $message);
959
-    }
960
-
961
-    /**
962
-     * Does strict comparison, so Assert::inArray(3, ['3']) does not pass the assertion.
963
-     *
964
-     * @psalm-pure
965
-     *
966
-     * @param mixed  $value
967
-     * @param array  $values
968
-     * @param string $message
969
-     *
970
-     * @throws InvalidArgumentException
971
-     */
972
-    public static function inArray($value, array $values, $message = '')
973
-    {
974
-        if (!\in_array($value, $values, true)) {
975
-            static::reportInvalidArgument(\sprintf(
976
-                $message ?: 'Expected one of: %2$s. Got: %s',
977
-                static::valueToString($value),
978
-                \implode(', ', \array_map(array('static', 'valueToString'), $values))
979
-            ));
980
-        }
981
-    }
982
-
983
-    /**
984
-     * @psalm-pure
985
-     *
986
-     * @param string $value
987
-     * @param string $subString
988
-     * @param string $message
989
-     *
990
-     * @throws InvalidArgumentException
991
-     */
992
-    public static function contains($value, $subString, $message = '')
993
-    {
994
-        if (false === \strpos($value, $subString)) {
995
-            static::reportInvalidArgument(\sprintf(
996
-                $message ?: 'Expected a value to contain %2$s. Got: %s',
997
-                static::valueToString($value),
998
-                static::valueToString($subString)
999
-            ));
1000
-        }
1001
-    }
1002
-
1003
-    /**
1004
-     * @psalm-pure
1005
-     *
1006
-     * @param string $value
1007
-     * @param string $subString
1008
-     * @param string $message
1009
-     *
1010
-     * @throws InvalidArgumentException
1011
-     */
1012
-    public static function notContains($value, $subString, $message = '')
1013
-    {
1014
-        if (false !== \strpos($value, $subString)) {
1015
-            static::reportInvalidArgument(\sprintf(
1016
-                $message ?: '%2$s was not expected to be contained in a value. Got: %s',
1017
-                static::valueToString($value),
1018
-                static::valueToString($subString)
1019
-            ));
1020
-        }
1021
-    }
1022
-
1023
-    /**
1024
-     * @psalm-pure
1025
-     *
1026
-     * @param string $value
1027
-     * @param string $message
1028
-     *
1029
-     * @throws InvalidArgumentException
1030
-     */
1031
-    public static function notWhitespaceOnly($value, $message = '')
1032
-    {
1033
-        if (\preg_match('/^\s*$/', $value)) {
1034
-            static::reportInvalidArgument(\sprintf(
1035
-                $message ?: 'Expected a non-whitespace string. Got: %s',
1036
-                static::valueToString($value)
1037
-            ));
1038
-        }
1039
-    }
1040
-
1041
-    /**
1042
-     * @psalm-pure
1043
-     *
1044
-     * @param string $value
1045
-     * @param string $prefix
1046
-     * @param string $message
1047
-     *
1048
-     * @throws InvalidArgumentException
1049
-     */
1050
-    public static function startsWith($value, $prefix, $message = '')
1051
-    {
1052
-        if (0 !== \strpos($value, $prefix)) {
1053
-            static::reportInvalidArgument(\sprintf(
1054
-                $message ?: 'Expected a value to start with %2$s. Got: %s',
1055
-                static::valueToString($value),
1056
-                static::valueToString($prefix)
1057
-            ));
1058
-        }
1059
-    }
1060
-
1061
-    /**
1062
-     * @psalm-pure
1063
-     *
1064
-     * @param string $value
1065
-     * @param string $prefix
1066
-     * @param string $message
1067
-     *
1068
-     * @throws InvalidArgumentException
1069
-     */
1070
-    public static function notStartsWith($value, $prefix, $message = '')
1071
-    {
1072
-        if (0 === \strpos($value, $prefix)) {
1073
-            static::reportInvalidArgument(\sprintf(
1074
-                $message ?: 'Expected a value not to start with %2$s. Got: %s',
1075
-                static::valueToString($value),
1076
-                static::valueToString($prefix)
1077
-            ));
1078
-        }
1079
-    }
1080
-
1081
-    /**
1082
-     * @psalm-pure
1083
-     *
1084
-     * @param mixed  $value
1085
-     * @param string $message
1086
-     *
1087
-     * @throws InvalidArgumentException
1088
-     */
1089
-    public static function startsWithLetter($value, $message = '')
1090
-    {
1091
-        static::string($value);
1092
-
1093
-        $valid = isset($value[0]);
1094
-
1095
-        if ($valid) {
1096
-            $locale = \setlocale(LC_CTYPE, 0);
1097
-            \setlocale(LC_CTYPE, 'C');
1098
-            $valid = \ctype_alpha($value[0]);
1099
-            \setlocale(LC_CTYPE, $locale);
1100
-        }
1101
-
1102
-        if (!$valid) {
1103
-            static::reportInvalidArgument(\sprintf(
1104
-                $message ?: 'Expected a value to start with a letter. Got: %s',
1105
-                static::valueToString($value)
1106
-            ));
1107
-        }
1108
-    }
1109
-
1110
-    /**
1111
-     * @psalm-pure
1112
-     *
1113
-     * @param string $value
1114
-     * @param string $suffix
1115
-     * @param string $message
1116
-     *
1117
-     * @throws InvalidArgumentException
1118
-     */
1119
-    public static function endsWith($value, $suffix, $message = '')
1120
-    {
1121
-        if ($suffix !== \substr($value, -\strlen($suffix))) {
1122
-            static::reportInvalidArgument(\sprintf(
1123
-                $message ?: 'Expected a value to end with %2$s. Got: %s',
1124
-                static::valueToString($value),
1125
-                static::valueToString($suffix)
1126
-            ));
1127
-        }
1128
-    }
1129
-
1130
-    /**
1131
-     * @psalm-pure
1132
-     *
1133
-     * @param string $value
1134
-     * @param string $suffix
1135
-     * @param string $message
1136
-     *
1137
-     * @throws InvalidArgumentException
1138
-     */
1139
-    public static function notEndsWith($value, $suffix, $message = '')
1140
-    {
1141
-        if ($suffix === \substr($value, -\strlen($suffix))) {
1142
-            static::reportInvalidArgument(\sprintf(
1143
-                $message ?: 'Expected a value not to end with %2$s. Got: %s',
1144
-                static::valueToString($value),
1145
-                static::valueToString($suffix)
1146
-            ));
1147
-        }
1148
-    }
1149
-
1150
-    /**
1151
-     * @psalm-pure
1152
-     *
1153
-     * @param string $value
1154
-     * @param string $pattern
1155
-     * @param string $message
1156
-     *
1157
-     * @throws InvalidArgumentException
1158
-     */
1159
-    public static function regex($value, $pattern, $message = '')
1160
-    {
1161
-        if (!\preg_match($pattern, $value)) {
1162
-            static::reportInvalidArgument(\sprintf(
1163
-                $message ?: 'The value %s does not match the expected pattern.',
1164
-                static::valueToString($value)
1165
-            ));
1166
-        }
1167
-    }
1168
-
1169
-    /**
1170
-     * @psalm-pure
1171
-     *
1172
-     * @param string $value
1173
-     * @param string $pattern
1174
-     * @param string $message
1175
-     *
1176
-     * @throws InvalidArgumentException
1177
-     */
1178
-    public static function notRegex($value, $pattern, $message = '')
1179
-    {
1180
-        if (\preg_match($pattern, $value, $matches, PREG_OFFSET_CAPTURE)) {
1181
-            static::reportInvalidArgument(\sprintf(
1182
-                $message ?: 'The value %s matches the pattern %s (at offset %d).',
1183
-                static::valueToString($value),
1184
-                static::valueToString($pattern),
1185
-                $matches[0][1]
1186
-            ));
1187
-        }
1188
-    }
1189
-
1190
-    /**
1191
-     * @psalm-pure
1192
-     *
1193
-     * @param mixed  $value
1194
-     * @param string $message
1195
-     *
1196
-     * @throws InvalidArgumentException
1197
-     */
1198
-    public static function unicodeLetters($value, $message = '')
1199
-    {
1200
-        static::string($value);
1201
-
1202
-        if (!\preg_match('/^\p{L}+$/u', $value)) {
1203
-            static::reportInvalidArgument(\sprintf(
1204
-                $message ?: 'Expected a value to contain only Unicode letters. Got: %s',
1205
-                static::valueToString($value)
1206
-            ));
1207
-        }
1208
-    }
1209
-
1210
-    /**
1211
-     * @psalm-pure
1212
-     *
1213
-     * @param mixed  $value
1214
-     * @param string $message
1215
-     *
1216
-     * @throws InvalidArgumentException
1217
-     */
1218
-    public static function alpha($value, $message = '')
1219
-    {
1220
-        static::string($value);
1221
-
1222
-        $locale = \setlocale(LC_CTYPE, 0);
1223
-        \setlocale(LC_CTYPE, 'C');
1224
-        $valid = !\ctype_alpha($value);
1225
-        \setlocale(LC_CTYPE, $locale);
1226
-
1227
-        if ($valid) {
1228
-            static::reportInvalidArgument(\sprintf(
1229
-                $message ?: 'Expected a value to contain only letters. Got: %s',
1230
-                static::valueToString($value)
1231
-            ));
1232
-        }
1233
-    }
1234
-
1235
-    /**
1236
-     * @psalm-pure
1237
-     *
1238
-     * @param string $value
1239
-     * @param string $message
1240
-     *
1241
-     * @throws InvalidArgumentException
1242
-     */
1243
-    public static function digits($value, $message = '')
1244
-    {
1245
-        $locale = \setlocale(LC_CTYPE, 0);
1246
-        \setlocale(LC_CTYPE, 'C');
1247
-        $valid = !\ctype_digit($value);
1248
-        \setlocale(LC_CTYPE, $locale);
1249
-
1250
-        if ($valid) {
1251
-            static::reportInvalidArgument(\sprintf(
1252
-                $message ?: 'Expected a value to contain digits only. Got: %s',
1253
-                static::valueToString($value)
1254
-            ));
1255
-        }
1256
-    }
1257
-
1258
-    /**
1259
-     * @psalm-pure
1260
-     *
1261
-     * @param string $value
1262
-     * @param string $message
1263
-     *
1264
-     * @throws InvalidArgumentException
1265
-     */
1266
-    public static function alnum($value, $message = '')
1267
-    {
1268
-        $locale = \setlocale(LC_CTYPE, 0);
1269
-        \setlocale(LC_CTYPE, 'C');
1270
-        $valid = !\ctype_alnum($value);
1271
-        \setlocale(LC_CTYPE, $locale);
1272
-
1273
-        if ($valid) {
1274
-            static::reportInvalidArgument(\sprintf(
1275
-                $message ?: 'Expected a value to contain letters and digits only. Got: %s',
1276
-                static::valueToString($value)
1277
-            ));
1278
-        }
1279
-    }
1280
-
1281
-    /**
1282
-     * @psalm-pure
1283
-     * @psalm-assert lowercase-string $value
1284
-     *
1285
-     * @param string $value
1286
-     * @param string $message
1287
-     *
1288
-     * @throws InvalidArgumentException
1289
-     */
1290
-    public static function lower($value, $message = '')
1291
-    {
1292
-        $locale = \setlocale(LC_CTYPE, 0);
1293
-        \setlocale(LC_CTYPE, 'C');
1294
-        $valid = !\ctype_lower($value);
1295
-        \setlocale(LC_CTYPE, $locale);
1296
-
1297
-        if ($valid) {
1298
-            static::reportInvalidArgument(\sprintf(
1299
-                $message ?: 'Expected a value to contain lowercase characters only. Got: %s',
1300
-                static::valueToString($value)
1301
-            ));
1302
-        }
1303
-    }
1304
-
1305
-    /**
1306
-     * @psalm-pure
1307
-     * @psalm-assert !lowercase-string $value
1308
-     *
1309
-     * @param string $value
1310
-     * @param string $message
1311
-     *
1312
-     * @throws InvalidArgumentException
1313
-     */
1314
-    public static function upper($value, $message = '')
1315
-    {
1316
-        $locale = \setlocale(LC_CTYPE, 0);
1317
-        \setlocale(LC_CTYPE, 'C');
1318
-        $valid = !\ctype_upper($value);
1319
-        \setlocale(LC_CTYPE, $locale);
1320
-
1321
-        if ($valid) {
1322
-            static::reportInvalidArgument(\sprintf(
1323
-                $message ?: 'Expected a value to contain uppercase characters only. Got: %s',
1324
-                static::valueToString($value)
1325
-            ));
1326
-        }
1327
-    }
1328
-
1329
-    /**
1330
-     * @psalm-pure
1331
-     *
1332
-     * @param string $value
1333
-     * @param int    $length
1334
-     * @param string $message
1335
-     *
1336
-     * @throws InvalidArgumentException
1337
-     */
1338
-    public static function length($value, $length, $message = '')
1339
-    {
1340
-        if ($length !== static::strlen($value)) {
1341
-            static::reportInvalidArgument(\sprintf(
1342
-                $message ?: 'Expected a value to contain %2$s characters. Got: %s',
1343
-                static::valueToString($value),
1344
-                $length
1345
-            ));
1346
-        }
1347
-    }
1348
-
1349
-    /**
1350
-     * Inclusive min.
1351
-     *
1352
-     * @psalm-pure
1353
-     *
1354
-     * @param string    $value
1355
-     * @param int|float $min
1356
-     * @param string    $message
1357
-     *
1358
-     * @throws InvalidArgumentException
1359
-     */
1360
-    public static function minLength($value, $min, $message = '')
1361
-    {
1362
-        if (static::strlen($value) < $min) {
1363
-            static::reportInvalidArgument(\sprintf(
1364
-                $message ?: 'Expected a value to contain at least %2$s characters. Got: %s',
1365
-                static::valueToString($value),
1366
-                $min
1367
-            ));
1368
-        }
1369
-    }
1370
-
1371
-    /**
1372
-     * Inclusive max.
1373
-     *
1374
-     * @psalm-pure
1375
-     *
1376
-     * @param string    $value
1377
-     * @param int|float $max
1378
-     * @param string    $message
1379
-     *
1380
-     * @throws InvalidArgumentException
1381
-     */
1382
-    public static function maxLength($value, $max, $message = '')
1383
-    {
1384
-        if (static::strlen($value) > $max) {
1385
-            static::reportInvalidArgument(\sprintf(
1386
-                $message ?: 'Expected a value to contain at most %2$s characters. Got: %s',
1387
-                static::valueToString($value),
1388
-                $max
1389
-            ));
1390
-        }
1391
-    }
1392
-
1393
-    /**
1394
-     * Inclusive , so Assert::lengthBetween('asd', 3, 5); passes the assertion.
1395
-     *
1396
-     * @psalm-pure
1397
-     *
1398
-     * @param string    $value
1399
-     * @param int|float $min
1400
-     * @param int|float $max
1401
-     * @param string    $message
1402
-     *
1403
-     * @throws InvalidArgumentException
1404
-     */
1405
-    public static function lengthBetween($value, $min, $max, $message = '')
1406
-    {
1407
-        $length = static::strlen($value);
1408
-
1409
-        if ($length < $min || $length > $max) {
1410
-            static::reportInvalidArgument(\sprintf(
1411
-                $message ?: 'Expected a value to contain between %2$s and %3$s characters. Got: %s',
1412
-                static::valueToString($value),
1413
-                $min,
1414
-                $max
1415
-            ));
1416
-        }
1417
-    }
1418
-
1419
-    /**
1420
-     * Will also pass if $value is a directory, use Assert::file() instead if you need to be sure it is a file.
1421
-     *
1422
-     * @param mixed  $value
1423
-     * @param string $message
1424
-     *
1425
-     * @throws InvalidArgumentException
1426
-     */
1427
-    public static function fileExists($value, $message = '')
1428
-    {
1429
-        static::string($value);
1430
-
1431
-        if (!\file_exists($value)) {
1432
-            static::reportInvalidArgument(\sprintf(
1433
-                $message ?: 'The file %s does not exist.',
1434
-                static::valueToString($value)
1435
-            ));
1436
-        }
1437
-    }
1438
-
1439
-    /**
1440
-     * @param mixed  $value
1441
-     * @param string $message
1442
-     *
1443
-     * @throws InvalidArgumentException
1444
-     */
1445
-    public static function file($value, $message = '')
1446
-    {
1447
-        static::fileExists($value, $message);
1448
-
1449
-        if (!\is_file($value)) {
1450
-            static::reportInvalidArgument(\sprintf(
1451
-                $message ?: 'The path %s is not a file.',
1452
-                static::valueToString($value)
1453
-            ));
1454
-        }
1455
-    }
1456
-
1457
-    /**
1458
-     * @param mixed  $value
1459
-     * @param string $message
1460
-     *
1461
-     * @throws InvalidArgumentException
1462
-     */
1463
-    public static function directory($value, $message = '')
1464
-    {
1465
-        static::fileExists($value, $message);
1466
-
1467
-        if (!\is_dir($value)) {
1468
-            static::reportInvalidArgument(\sprintf(
1469
-                $message ?: 'The path %s is no directory.',
1470
-                static::valueToString($value)
1471
-            ));
1472
-        }
1473
-    }
1474
-
1475
-    /**
1476
-     * @param string $value
1477
-     * @param string $message
1478
-     *
1479
-     * @throws InvalidArgumentException
1480
-     */
1481
-    public static function readable($value, $message = '')
1482
-    {
1483
-        if (!\is_readable($value)) {
1484
-            static::reportInvalidArgument(\sprintf(
1485
-                $message ?: 'The path %s is not readable.',
1486
-                static::valueToString($value)
1487
-            ));
1488
-        }
1489
-    }
1490
-
1491
-    /**
1492
-     * @param string $value
1493
-     * @param string $message
1494
-     *
1495
-     * @throws InvalidArgumentException
1496
-     */
1497
-    public static function writable($value, $message = '')
1498
-    {
1499
-        if (!\is_writable($value)) {
1500
-            static::reportInvalidArgument(\sprintf(
1501
-                $message ?: 'The path %s is not writable.',
1502
-                static::valueToString($value)
1503
-            ));
1504
-        }
1505
-    }
1506
-
1507
-    /**
1508
-     * @psalm-assert class-string $value
1509
-     *
1510
-     * @param mixed  $value
1511
-     * @param string $message
1512
-     *
1513
-     * @throws InvalidArgumentException
1514
-     */
1515
-    public static function classExists($value, $message = '')
1516
-    {
1517
-        if (!\class_exists($value)) {
1518
-            static::reportInvalidArgument(\sprintf(
1519
-                $message ?: 'Expected an existing class name. Got: %s',
1520
-                static::valueToString($value)
1521
-            ));
1522
-        }
1523
-    }
1524
-
1525
-    /**
1526
-     * @psalm-pure
1527
-     * @psalm-template ExpectedType of object
1528
-     * @psalm-param class-string<ExpectedType> $class
1529
-     * @psalm-assert class-string<ExpectedType>|ExpectedType $value
1530
-     *
1531
-     * @param mixed         $value
1532
-     * @param string|object $class
1533
-     * @param string        $message
1534
-     *
1535
-     * @throws InvalidArgumentException
1536
-     */
1537
-    public static function subclassOf($value, $class, $message = '')
1538
-    {
1539
-        if (!\is_subclass_of($value, $class)) {
1540
-            static::reportInvalidArgument(\sprintf(
1541
-                $message ?: 'Expected a sub-class of %2$s. Got: %s',
1542
-                static::valueToString($value),
1543
-                static::valueToString($class)
1544
-            ));
1545
-        }
1546
-    }
1547
-
1548
-    /**
1549
-     * @psalm-assert class-string $value
1550
-     *
1551
-     * @param mixed  $value
1552
-     * @param string $message
1553
-     *
1554
-     * @throws InvalidArgumentException
1555
-     */
1556
-    public static function interfaceExists($value, $message = '')
1557
-    {
1558
-        if (!\interface_exists($value)) {
1559
-            static::reportInvalidArgument(\sprintf(
1560
-                $message ?: 'Expected an existing interface name. got %s',
1561
-                static::valueToString($value)
1562
-            ));
1563
-        }
1564
-    }
1565
-
1566
-    /**
1567
-     * @psalm-pure
1568
-     * @psalm-template ExpectedType of object
1569
-     * @psalm-param class-string<ExpectedType> $interface
1570
-     * @psalm-assert class-string<ExpectedType> $value
1571
-     *
1572
-     * @param mixed  $value
1573
-     * @param mixed  $interface
1574
-     * @param string $message
1575
-     *
1576
-     * @throws InvalidArgumentException
1577
-     */
1578
-    public static function implementsInterface($value, $interface, $message = '')
1579
-    {
1580
-        if (!\in_array($interface, \class_implements($value))) {
1581
-            static::reportInvalidArgument(\sprintf(
1582
-                $message ?: 'Expected an implementation of %2$s. Got: %s',
1583
-                static::valueToString($value),
1584
-                static::valueToString($interface)
1585
-            ));
1586
-        }
1587
-    }
1588
-
1589
-    /**
1590
-     * @psalm-pure
1591
-     * @psalm-param class-string|object $classOrObject
1592
-     *
1593
-     * @param string|object $classOrObject
1594
-     * @param mixed         $property
1595
-     * @param string        $message
1596
-     *
1597
-     * @throws InvalidArgumentException
1598
-     */
1599
-    public static function propertyExists($classOrObject, $property, $message = '')
1600
-    {
1601
-        if (!\property_exists($classOrObject, $property)) {
1602
-            static::reportInvalidArgument(\sprintf(
1603
-                $message ?: 'Expected the property %s to exist.',
1604
-                static::valueToString($property)
1605
-            ));
1606
-        }
1607
-    }
1608
-
1609
-    /**
1610
-     * @psalm-pure
1611
-     * @psalm-param class-string|object $classOrObject
1612
-     *
1613
-     * @param string|object $classOrObject
1614
-     * @param mixed         $property
1615
-     * @param string        $message
1616
-     *
1617
-     * @throws InvalidArgumentException
1618
-     */
1619
-    public static function propertyNotExists($classOrObject, $property, $message = '')
1620
-    {
1621
-        if (\property_exists($classOrObject, $property)) {
1622
-            static::reportInvalidArgument(\sprintf(
1623
-                $message ?: 'Expected the property %s to not exist.',
1624
-                static::valueToString($property)
1625
-            ));
1626
-        }
1627
-    }
1628
-
1629
-    /**
1630
-     * @psalm-pure
1631
-     * @psalm-param class-string|object $classOrObject
1632
-     *
1633
-     * @param string|object $classOrObject
1634
-     * @param mixed         $method
1635
-     * @param string        $message
1636
-     *
1637
-     * @throws InvalidArgumentException
1638
-     */
1639
-    public static function methodExists($classOrObject, $method, $message = '')
1640
-    {
1641
-        if (!(\is_string($classOrObject) || \is_object($classOrObject)) || !\method_exists($classOrObject, $method)) {
1642
-            static::reportInvalidArgument(\sprintf(
1643
-                $message ?: 'Expected the method %s to exist.',
1644
-                static::valueToString($method)
1645
-            ));
1646
-        }
1647
-    }
1648
-
1649
-    /**
1650
-     * @psalm-pure
1651
-     * @psalm-param class-string|object $classOrObject
1652
-     *
1653
-     * @param string|object $classOrObject
1654
-     * @param mixed         $method
1655
-     * @param string        $message
1656
-     *
1657
-     * @throws InvalidArgumentException
1658
-     */
1659
-    public static function methodNotExists($classOrObject, $method, $message = '')
1660
-    {
1661
-        if ((\is_string($classOrObject) || \is_object($classOrObject)) && \method_exists($classOrObject, $method)) {
1662
-            static::reportInvalidArgument(\sprintf(
1663
-                $message ?: 'Expected the method %s to not exist.',
1664
-                static::valueToString($method)
1665
-            ));
1666
-        }
1667
-    }
1668
-
1669
-    /**
1670
-     * @psalm-pure
1671
-     *
1672
-     * @param array      $array
1673
-     * @param string|int $key
1674
-     * @param string     $message
1675
-     *
1676
-     * @throws InvalidArgumentException
1677
-     */
1678
-    public static function keyExists($array, $key, $message = '')
1679
-    {
1680
-        if (!(isset($array[$key]) || \array_key_exists($key, $array))) {
1681
-            static::reportInvalidArgument(\sprintf(
1682
-                $message ?: 'Expected the key %s to exist.',
1683
-                static::valueToString($key)
1684
-            ));
1685
-        }
1686
-    }
1687
-
1688
-    /**
1689
-     * @psalm-pure
1690
-     *
1691
-     * @param array      $array
1692
-     * @param string|int $key
1693
-     * @param string     $message
1694
-     *
1695
-     * @throws InvalidArgumentException
1696
-     */
1697
-    public static function keyNotExists($array, $key, $message = '')
1698
-    {
1699
-        if (isset($array[$key]) || \array_key_exists($key, $array)) {
1700
-            static::reportInvalidArgument(\sprintf(
1701
-                $message ?: 'Expected the key %s to not exist.',
1702
-                static::valueToString($key)
1703
-            ));
1704
-        }
1705
-    }
1706
-
1707
-    /**
1708
-     * Checks if a value is a valid array key (int or string).
1709
-     *
1710
-     * @psalm-pure
1711
-     * @psalm-assert array-key $value
1712
-     *
1713
-     * @param mixed  $value
1714
-     * @param string $message
1715
-     *
1716
-     * @throws InvalidArgumentException
1717
-     */
1718
-    public static function validArrayKey($value, $message = '')
1719
-    {
1720
-        if (!(\is_int($value) || \is_string($value))) {
1721
-            static::reportInvalidArgument(\sprintf(
1722
-                $message ?: 'Expected string or integer. Got: %s',
1723
-                static::typeToString($value)
1724
-            ));
1725
-        }
1726
-    }
1727
-
1728
-    /**
1729
-     * Does not check if $array is countable, this can generate a warning on php versions after 7.2.
1730
-     *
1731
-     * @param Countable|array $array
1732
-     * @param int             $number
1733
-     * @param string          $message
1734
-     *
1735
-     * @throws InvalidArgumentException
1736
-     */
1737
-    public static function count($array, $number, $message = '')
1738
-    {
1739
-        static::eq(
1740
-            \count($array),
1741
-            $number,
1742
-            \sprintf(
1743
-                $message ?: 'Expected an array to contain %d elements. Got: %d.',
1744
-                $number,
1745
-                \count($array)
1746
-            )
1747
-        );
1748
-    }
1749
-
1750
-    /**
1751
-     * Does not check if $array is countable, this can generate a warning on php versions after 7.2.
1752
-     *
1753
-     * @param Countable|array $array
1754
-     * @param int|float       $min
1755
-     * @param string          $message
1756
-     *
1757
-     * @throws InvalidArgumentException
1758
-     */
1759
-    public static function minCount($array, $min, $message = '')
1760
-    {
1761
-        if (\count($array) < $min) {
1762
-            static::reportInvalidArgument(\sprintf(
1763
-                $message ?: 'Expected an array to contain at least %2$d elements. Got: %d',
1764
-                \count($array),
1765
-                $min
1766
-            ));
1767
-        }
1768
-    }
1769
-
1770
-    /**
1771
-     * Does not check if $array is countable, this can generate a warning on php versions after 7.2.
1772
-     *
1773
-     * @param Countable|array $array
1774
-     * @param int|float       $max
1775
-     * @param string          $message
1776
-     *
1777
-     * @throws InvalidArgumentException
1778
-     */
1779
-    public static function maxCount($array, $max, $message = '')
1780
-    {
1781
-        if (\count($array) > $max) {
1782
-            static::reportInvalidArgument(\sprintf(
1783
-                $message ?: 'Expected an array to contain at most %2$d elements. Got: %d',
1784
-                \count($array),
1785
-                $max
1786
-            ));
1787
-        }
1788
-    }
1789
-
1790
-    /**
1791
-     * Does not check if $array is countable, this can generate a warning on php versions after 7.2.
1792
-     *
1793
-     * @param Countable|array $array
1794
-     * @param int|float       $min
1795
-     * @param int|float       $max
1796
-     * @param string          $message
1797
-     *
1798
-     * @throws InvalidArgumentException
1799
-     */
1800
-    public static function countBetween($array, $min, $max, $message = '')
1801
-    {
1802
-        $count = \count($array);
1803
-
1804
-        if ($count < $min || $count > $max) {
1805
-            static::reportInvalidArgument(\sprintf(
1806
-                $message ?: 'Expected an array to contain between %2$d and %3$d elements. Got: %d',
1807
-                $count,
1808
-                $min,
1809
-                $max
1810
-            ));
1811
-        }
1812
-    }
1813
-
1814
-    /**
1815
-     * @psalm-pure
1816
-     * @psalm-assert list $array
1817
-     *
1818
-     * @param mixed  $array
1819
-     * @param string $message
1820
-     *
1821
-     * @throws InvalidArgumentException
1822
-     */
1823
-    public static function isList($array, $message = '')
1824
-    {
1825
-        if (!\is_array($array) || $array !== \array_values($array)) {
1826
-            static::reportInvalidArgument(
1827
-                $message ?: 'Expected list - non-associative array.'
1828
-            );
1829
-        }
1830
-    }
1831
-
1832
-    /**
1833
-     * @psalm-pure
1834
-     * @psalm-assert non-empty-list $array
1835
-     *
1836
-     * @param mixed  $array
1837
-     * @param string $message
1838
-     *
1839
-     * @throws InvalidArgumentException
1840
-     */
1841
-    public static function isNonEmptyList($array, $message = '')
1842
-    {
1843
-        static::isList($array, $message);
1844
-        static::notEmpty($array, $message);
1845
-    }
1846
-
1847
-    /**
1848
-     * @psalm-pure
1849
-     * @psalm-template T
1850
-     * @psalm-param mixed|array<T> $array
1851
-     * @psalm-assert array<string, T> $array
1852
-     *
1853
-     * @param mixed  $array
1854
-     * @param string $message
1855
-     *
1856
-     * @throws InvalidArgumentException
1857
-     */
1858
-    public static function isMap($array, $message = '')
1859
-    {
1860
-        if (
1861
-            !\is_array($array) ||
1862
-            \array_keys($array) !== \array_filter(\array_keys($array), '\is_string')
1863
-        ) {
1864
-            static::reportInvalidArgument(
1865
-                $message ?: 'Expected map - associative array with string keys.'
1866
-            );
1867
-        }
1868
-    }
1869
-
1870
-    /**
1871
-     * @psalm-pure
1872
-     * @psalm-template T
1873
-     * @psalm-param mixed|array<T> $array
1874
-     * @psalm-assert array<string, T> $array
1875
-     * @psalm-assert !empty $array
1876
-     *
1877
-     * @param mixed  $array
1878
-     * @param string $message
1879
-     *
1880
-     * @throws InvalidArgumentException
1881
-     */
1882
-    public static function isNonEmptyMap($array, $message = '')
1883
-    {
1884
-        static::isMap($array, $message);
1885
-        static::notEmpty($array, $message);
1886
-    }
1887
-
1888
-    /**
1889
-     * @psalm-pure
1890
-     *
1891
-     * @param string $value
1892
-     * @param string $message
1893
-     *
1894
-     * @throws InvalidArgumentException
1895
-     */
1896
-    public static function uuid($value, $message = '')
1897
-    {
1898
-        $value = \str_replace(array('urn:', 'uuid:', '{', '}'), '', $value);
1899
-
1900
-        // The nil UUID is special form of UUID that is specified to have all
1901
-        // 128 bits set to zero.
1902
-        if ('00000000-0000-0000-0000-000000000000' === $value) {
1903
-            return;
1904
-        }
1905
-
1906
-        if (!\preg_match('/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/', $value)) {
1907
-            static::reportInvalidArgument(\sprintf(
1908
-                $message ?: 'Value %s is not a valid UUID.',
1909
-                static::valueToString($value)
1910
-            ));
1911
-        }
1912
-    }
1913
-
1914
-    /**
1915
-     * @psalm-param class-string<Throwable> $class
1916
-     *
1917
-     * @param Closure $expression
1918
-     * @param string  $class
1919
-     * @param string  $message
1920
-     *
1921
-     * @throws InvalidArgumentException
1922
-     */
1923
-    public static function throws(Closure $expression, $class = 'Exception', $message = '')
1924
-    {
1925
-        static::string($class);
1926
-
1927
-        $actual = 'none';
1928
-
1929
-        try {
1930
-            $expression();
1931
-        } catch (Exception $e) {
1932
-            $actual = \get_class($e);
1933
-            if ($e instanceof $class) {
1934
-                return;
1935
-            }
1936
-        } catch (Throwable $e) {
1937
-            $actual = \get_class($e);
1938
-            if ($e instanceof $class) {
1939
-                return;
1940
-            }
1941
-        }
1942
-
1943
-        static::reportInvalidArgument($message ?: \sprintf(
1944
-            'Expected to throw "%s", got "%s"',
1945
-            $class,
1946
-            $actual
1947
-        ));
1948
-    }
1949
-
1950
-    /**
1951
-     * @throws BadMethodCallException
1952
-     */
1953
-    public static function __callStatic($name, $arguments)
1954
-    {
1955
-        if ('nullOr' === \substr($name, 0, 6)) {
1956
-            if (null !== $arguments[0]) {
1957
-                $method = \lcfirst(\substr($name, 6));
1958
-                \call_user_func_array(array('static', $method), $arguments);
1959
-            }
1960
-
1961
-            return;
1962
-        }
1963
-
1964
-        if ('all' === \substr($name, 0, 3)) {
1965
-            static::isIterable($arguments[0]);
1966
-
1967
-            $method = \lcfirst(\substr($name, 3));
1968
-            $args = $arguments;
1969
-
1970
-            foreach ($arguments[0] as $entry) {
1971
-                $args[0] = $entry;
1972
-
1973
-                \call_user_func_array(array('static', $method), $args);
1974
-            }
1975
-
1976
-            return;
1977
-        }
1978
-
1979
-        throw new BadMethodCallException('No such method: '.$name);
1980
-    }
1981
-
1982
-    /**
1983
-     * @param mixed $value
1984
-     *
1985
-     * @return string
1986
-     */
1987
-    protected static function valueToString($value)
1988
-    {
1989
-        if (null === $value) {
1990
-            return 'null';
1991
-        }
1992
-
1993
-        if (true === $value) {
1994
-            return 'true';
1995
-        }
1996
-
1997
-        if (false === $value) {
1998
-            return 'false';
1999
-        }
2000
-
2001
-        if (\is_array($value)) {
2002
-            return 'array';
2003
-        }
2004
-
2005
-        if (\is_object($value)) {
2006
-            if (\method_exists($value, '__toString')) {
2007
-                return \get_class($value).': '.self::valueToString($value->__toString());
2008
-            }
2009
-
2010
-            if ($value instanceof DateTime || $value instanceof DateTimeImmutable) {
2011
-                return \get_class($value).': '.self::valueToString($value->format('c'));
2012
-            }
2013
-
2014
-            return \get_class($value);
2015
-        }
2016
-
2017
-        if (\is_resource($value)) {
2018
-            return 'resource';
2019
-        }
2020
-
2021
-        if (\is_string($value)) {
2022
-            return '"'.$value.'"';
2023
-        }
2024
-
2025
-        return (string) $value;
2026
-    }
2027
-
2028
-    /**
2029
-     * @param mixed $value
2030
-     *
2031
-     * @return string
2032
-     */
2033
-    protected static function typeToString($value)
2034
-    {
2035
-        return \is_object($value) ? \get_class($value) : \gettype($value);
2036
-    }
2037
-
2038
-    protected static function strlen($value)
2039
-    {
2040
-        if (!\function_exists('mb_detect_encoding')) {
2041
-            return \strlen($value);
2042
-        }
2043
-
2044
-        if (false === $encoding = \mb_detect_encoding($value)) {
2045
-            return \strlen($value);
2046
-        }
2047
-
2048
-        return \mb_strlen($value, $encoding);
2049
-    }
2050
-
2051
-    /**
2052
-     * @param string $message
2053
-     *
2054
-     * @throws InvalidArgumentException
2055
-     *
2056
-     * @psalm-pure this method is not supposed to perform side-effects
2057
-     */
2058
-    protected static function reportInvalidArgument($message)
2059
-    {
2060
-        throw new InvalidArgumentException($message);
2061
-    }
2062
-
2063
-    private function __construct()
2064
-    {
2065
-    }
35
+	use Mixin;
36
+
37
+	/**
38
+	 * @psalm-pure
39
+	 * @psalm-assert string $value
40
+	 *
41
+	 * @param mixed  $value
42
+	 * @param string $message
43
+	 *
44
+	 * @throws InvalidArgumentException
45
+	 */
46
+	public static function string($value, $message = '')
47
+	{
48
+		if (!\is_string($value)) {
49
+			static::reportInvalidArgument(\sprintf(
50
+				$message ?: 'Expected a string. Got: %s',
51
+				static::typeToString($value)
52
+			));
53
+		}
54
+	}
55
+
56
+	/**
57
+	 * @psalm-pure
58
+	 * @psalm-assert non-empty-string $value
59
+	 *
60
+	 * @param mixed  $value
61
+	 * @param string $message
62
+	 *
63
+	 * @throws InvalidArgumentException
64
+	 */
65
+	public static function stringNotEmpty($value, $message = '')
66
+	{
67
+		static::string($value, $message);
68
+		static::notEq($value, '', $message);
69
+	}
70
+
71
+	/**
72
+	 * @psalm-pure
73
+	 * @psalm-assert int $value
74
+	 *
75
+	 * @param mixed  $value
76
+	 * @param string $message
77
+	 *
78
+	 * @throws InvalidArgumentException
79
+	 */
80
+	public static function integer($value, $message = '')
81
+	{
82
+		if (!\is_int($value)) {
83
+			static::reportInvalidArgument(\sprintf(
84
+				$message ?: 'Expected an integer. Got: %s',
85
+				static::typeToString($value)
86
+			));
87
+		}
88
+	}
89
+
90
+	/**
91
+	 * @psalm-pure
92
+	 * @psalm-assert numeric $value
93
+	 *
94
+	 * @param mixed  $value
95
+	 * @param string $message
96
+	 *
97
+	 * @throws InvalidArgumentException
98
+	 */
99
+	public static function integerish($value, $message = '')
100
+	{
101
+		if (!\is_numeric($value) || $value != (int) $value) {
102
+			static::reportInvalidArgument(\sprintf(
103
+				$message ?: 'Expected an integerish value. Got: %s',
104
+				static::typeToString($value)
105
+			));
106
+		}
107
+	}
108
+
109
+	/**
110
+	 * @psalm-pure
111
+	 * @psalm-assert positive-int $value
112
+	 *
113
+	 * @param mixed  $value
114
+	 * @param string $message
115
+	 *
116
+	 * @throws InvalidArgumentException
117
+	 */
118
+	public static function positiveInteger($value, $message = '')
119
+	{
120
+		if (!(\is_int($value) && $value > 0)) {
121
+			static::reportInvalidArgument(\sprintf(
122
+				$message ?: 'Expected a positive integer. Got: %s',
123
+				static::valueToString($value)
124
+			));
125
+		}
126
+	}
127
+
128
+	/**
129
+	 * @psalm-pure
130
+	 * @psalm-assert float $value
131
+	 *
132
+	 * @param mixed  $value
133
+	 * @param string $message
134
+	 *
135
+	 * @throws InvalidArgumentException
136
+	 */
137
+	public static function float($value, $message = '')
138
+	{
139
+		if (!\is_float($value)) {
140
+			static::reportInvalidArgument(\sprintf(
141
+				$message ?: 'Expected a float. Got: %s',
142
+				static::typeToString($value)
143
+			));
144
+		}
145
+	}
146
+
147
+	/**
148
+	 * @psalm-pure
149
+	 * @psalm-assert numeric $value
150
+	 *
151
+	 * @param mixed  $value
152
+	 * @param string $message
153
+	 *
154
+	 * @throws InvalidArgumentException
155
+	 */
156
+	public static function numeric($value, $message = '')
157
+	{
158
+		if (!\is_numeric($value)) {
159
+			static::reportInvalidArgument(\sprintf(
160
+				$message ?: 'Expected a numeric. Got: %s',
161
+				static::typeToString($value)
162
+			));
163
+		}
164
+	}
165
+
166
+	/**
167
+	 * @psalm-pure
168
+	 * @psalm-assert positive-int|0 $value
169
+	 *
170
+	 * @param mixed  $value
171
+	 * @param string $message
172
+	 *
173
+	 * @throws InvalidArgumentException
174
+	 */
175
+	public static function natural($value, $message = '')
176
+	{
177
+		if (!\is_int($value) || $value < 0) {
178
+			static::reportInvalidArgument(\sprintf(
179
+				$message ?: 'Expected a non-negative integer. Got: %s',
180
+				static::valueToString($value)
181
+			));
182
+		}
183
+	}
184
+
185
+	/**
186
+	 * @psalm-pure
187
+	 * @psalm-assert bool $value
188
+	 *
189
+	 * @param mixed  $value
190
+	 * @param string $message
191
+	 *
192
+	 * @throws InvalidArgumentException
193
+	 */
194
+	public static function boolean($value, $message = '')
195
+	{
196
+		if (!\is_bool($value)) {
197
+			static::reportInvalidArgument(\sprintf(
198
+				$message ?: 'Expected a boolean. Got: %s',
199
+				static::typeToString($value)
200
+			));
201
+		}
202
+	}
203
+
204
+	/**
205
+	 * @psalm-pure
206
+	 * @psalm-assert scalar $value
207
+	 *
208
+	 * @param mixed  $value
209
+	 * @param string $message
210
+	 *
211
+	 * @throws InvalidArgumentException
212
+	 */
213
+	public static function scalar($value, $message = '')
214
+	{
215
+		if (!\is_scalar($value)) {
216
+			static::reportInvalidArgument(\sprintf(
217
+				$message ?: 'Expected a scalar. Got: %s',
218
+				static::typeToString($value)
219
+			));
220
+		}
221
+	}
222
+
223
+	/**
224
+	 * @psalm-pure
225
+	 * @psalm-assert object $value
226
+	 *
227
+	 * @param mixed  $value
228
+	 * @param string $message
229
+	 *
230
+	 * @throws InvalidArgumentException
231
+	 */
232
+	public static function object($value, $message = '')
233
+	{
234
+		if (!\is_object($value)) {
235
+			static::reportInvalidArgument(\sprintf(
236
+				$message ?: 'Expected an object. Got: %s',
237
+				static::typeToString($value)
238
+			));
239
+		}
240
+	}
241
+
242
+	/**
243
+	 * @psalm-pure
244
+	 * @psalm-assert resource $value
245
+	 *
246
+	 * @param mixed       $value
247
+	 * @param string|null $type    type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php
248
+	 * @param string      $message
249
+	 *
250
+	 * @throws InvalidArgumentException
251
+	 */
252
+	public static function resource($value, $type = null, $message = '')
253
+	{
254
+		if (!\is_resource($value)) {
255
+			static::reportInvalidArgument(\sprintf(
256
+				$message ?: 'Expected a resource. Got: %s',
257
+				static::typeToString($value)
258
+			));
259
+		}
260
+
261
+		if ($type && $type !== \get_resource_type($value)) {
262
+			static::reportInvalidArgument(\sprintf(
263
+				$message ?: 'Expected a resource of type %2$s. Got: %s',
264
+				static::typeToString($value),
265
+				$type
266
+			));
267
+		}
268
+	}
269
+
270
+	/**
271
+	 * @psalm-pure
272
+	 * @psalm-assert callable $value
273
+	 *
274
+	 * @param mixed  $value
275
+	 * @param string $message
276
+	 *
277
+	 * @throws InvalidArgumentException
278
+	 */
279
+	public static function isCallable($value, $message = '')
280
+	{
281
+		if (!\is_callable($value)) {
282
+			static::reportInvalidArgument(\sprintf(
283
+				$message ?: 'Expected a callable. Got: %s',
284
+				static::typeToString($value)
285
+			));
286
+		}
287
+	}
288
+
289
+	/**
290
+	 * @psalm-pure
291
+	 * @psalm-assert array $value
292
+	 *
293
+	 * @param mixed  $value
294
+	 * @param string $message
295
+	 *
296
+	 * @throws InvalidArgumentException
297
+	 */
298
+	public static function isArray($value, $message = '')
299
+	{
300
+		if (!\is_array($value)) {
301
+			static::reportInvalidArgument(\sprintf(
302
+				$message ?: 'Expected an array. Got: %s',
303
+				static::typeToString($value)
304
+			));
305
+		}
306
+	}
307
+
308
+	/**
309
+	 * @psalm-pure
310
+	 * @psalm-assert iterable $value
311
+	 *
312
+	 * @deprecated use "isIterable" or "isInstanceOf" instead
313
+	 *
314
+	 * @param mixed  $value
315
+	 * @param string $message
316
+	 *
317
+	 * @throws InvalidArgumentException
318
+	 */
319
+	public static function isTraversable($value, $message = '')
320
+	{
321
+		@\trigger_error(
322
+			\sprintf(
323
+				'The "%s" assertion is deprecated. You should stop using it, as it will soon be removed in 2.0 version. Use "isIterable" or "isInstanceOf" instead.',
324
+				__METHOD__
325
+			),
326
+			\E_USER_DEPRECATED
327
+		);
328
+
329
+		if (!\is_array($value) && !($value instanceof Traversable)) {
330
+			static::reportInvalidArgument(\sprintf(
331
+				$message ?: 'Expected a traversable. Got: %s',
332
+				static::typeToString($value)
333
+			));
334
+		}
335
+	}
336
+
337
+	/**
338
+	 * @psalm-pure
339
+	 * @psalm-assert array|ArrayAccess $value
340
+	 *
341
+	 * @param mixed  $value
342
+	 * @param string $message
343
+	 *
344
+	 * @throws InvalidArgumentException
345
+	 */
346
+	public static function isArrayAccessible($value, $message = '')
347
+	{
348
+		if (!\is_array($value) && !($value instanceof ArrayAccess)) {
349
+			static::reportInvalidArgument(\sprintf(
350
+				$message ?: 'Expected an array accessible. Got: %s',
351
+				static::typeToString($value)
352
+			));
353
+		}
354
+	}
355
+
356
+	/**
357
+	 * @psalm-pure
358
+	 * @psalm-assert countable $value
359
+	 *
360
+	 * @param mixed  $value
361
+	 * @param string $message
362
+	 *
363
+	 * @throws InvalidArgumentException
364
+	 */
365
+	public static function isCountable($value, $message = '')
366
+	{
367
+		if (
368
+			!\is_array($value)
369
+			&& !($value instanceof Countable)
370
+			&& !($value instanceof ResourceBundle)
371
+			&& !($value instanceof SimpleXMLElement)
372
+		) {
373
+			static::reportInvalidArgument(\sprintf(
374
+				$message ?: 'Expected a countable. Got: %s',
375
+				static::typeToString($value)
376
+			));
377
+		}
378
+	}
379
+
380
+	/**
381
+	 * @psalm-pure
382
+	 * @psalm-assert iterable $value
383
+	 *
384
+	 * @param mixed  $value
385
+	 * @param string $message
386
+	 *
387
+	 * @throws InvalidArgumentException
388
+	 */
389
+	public static function isIterable($value, $message = '')
390
+	{
391
+		if (!\is_array($value) && !($value instanceof Traversable)) {
392
+			static::reportInvalidArgument(\sprintf(
393
+				$message ?: 'Expected an iterable. Got: %s',
394
+				static::typeToString($value)
395
+			));
396
+		}
397
+	}
398
+
399
+	/**
400
+	 * @psalm-pure
401
+	 * @psalm-template ExpectedType of object
402
+	 * @psalm-param class-string<ExpectedType> $class
403
+	 * @psalm-assert ExpectedType $value
404
+	 *
405
+	 * @param mixed         $value
406
+	 * @param string|object $class
407
+	 * @param string        $message
408
+	 *
409
+	 * @throws InvalidArgumentException
410
+	 */
411
+	public static function isInstanceOf($value, $class, $message = '')
412
+	{
413
+		if (!($value instanceof $class)) {
414
+			static::reportInvalidArgument(\sprintf(
415
+				$message ?: 'Expected an instance of %2$s. Got: %s',
416
+				static::typeToString($value),
417
+				$class
418
+			));
419
+		}
420
+	}
421
+
422
+	/**
423
+	 * @psalm-pure
424
+	 * @psalm-template ExpectedType of object
425
+	 * @psalm-param class-string<ExpectedType> $class
426
+	 * @psalm-assert !ExpectedType $value
427
+	 *
428
+	 * @param mixed         $value
429
+	 * @param string|object $class
430
+	 * @param string        $message
431
+	 *
432
+	 * @throws InvalidArgumentException
433
+	 */
434
+	public static function notInstanceOf($value, $class, $message = '')
435
+	{
436
+		if ($value instanceof $class) {
437
+			static::reportInvalidArgument(\sprintf(
438
+				$message ?: 'Expected an instance other than %2$s. Got: %s',
439
+				static::typeToString($value),
440
+				$class
441
+			));
442
+		}
443
+	}
444
+
445
+	/**
446
+	 * @psalm-pure
447
+	 * @psalm-param array<class-string> $classes
448
+	 *
449
+	 * @param mixed                $value
450
+	 * @param array<object|string> $classes
451
+	 * @param string               $message
452
+	 *
453
+	 * @throws InvalidArgumentException
454
+	 */
455
+	public static function isInstanceOfAny($value, array $classes, $message = '')
456
+	{
457
+		foreach ($classes as $class) {
458
+			if ($value instanceof $class) {
459
+				return;
460
+			}
461
+		}
462
+
463
+		static::reportInvalidArgument(\sprintf(
464
+			$message ?: 'Expected an instance of any of %2$s. Got: %s',
465
+			static::typeToString($value),
466
+			\implode(', ', \array_map(array('static', 'valueToString'), $classes))
467
+		));
468
+	}
469
+
470
+	/**
471
+	 * @psalm-pure
472
+	 * @psalm-template ExpectedType of object
473
+	 * @psalm-param class-string<ExpectedType> $class
474
+	 * @psalm-assert ExpectedType|class-string<ExpectedType> $value
475
+	 *
476
+	 * @param object|string $value
477
+	 * @param string        $class
478
+	 * @param string        $message
479
+	 *
480
+	 * @throws InvalidArgumentException
481
+	 */
482
+	public static function isAOf($value, $class, $message = '')
483
+	{
484
+		static::string($class, 'Expected class as a string. Got: %s');
485
+
486
+		if (!\is_a($value, $class, \is_string($value))) {
487
+			static::reportInvalidArgument(sprintf(
488
+				$message ?: 'Expected an instance of this class or to this class among his parents %2$s. Got: %s',
489
+				static::typeToString($value),
490
+				$class
491
+			));
492
+		}
493
+	}
494
+
495
+	/**
496
+	 * @psalm-pure
497
+	 * @psalm-template UnexpectedType of object
498
+	 * @psalm-param class-string<UnexpectedType> $class
499
+	 * @psalm-assert !UnexpectedType $value
500
+	 * @psalm-assert !class-string<UnexpectedType> $value
501
+	 *
502
+	 * @param object|string $value
503
+	 * @param string        $class
504
+	 * @param string        $message
505
+	 *
506
+	 * @throws InvalidArgumentException
507
+	 */
508
+	public static function isNotA($value, $class, $message = '')
509
+	{
510
+		static::string($class, 'Expected class as a string. Got: %s');
511
+
512
+		if (\is_a($value, $class, \is_string($value))) {
513
+			static::reportInvalidArgument(sprintf(
514
+				$message ?: 'Expected an instance of this class or to this class among his parents other than %2$s. Got: %s',
515
+				static::typeToString($value),
516
+				$class
517
+			));
518
+		}
519
+	}
520
+
521
+	/**
522
+	 * @psalm-pure
523
+	 * @psalm-param array<class-string> $classes
524
+	 *
525
+	 * @param object|string $value
526
+	 * @param string[]      $classes
527
+	 * @param string        $message
528
+	 *
529
+	 * @throws InvalidArgumentException
530
+	 */
531
+	public static function isAnyOf($value, array $classes, $message = '')
532
+	{
533
+		foreach ($classes as $class) {
534
+			static::string($class, 'Expected class as a string. Got: %s');
535
+
536
+			if (\is_a($value, $class, \is_string($value))) {
537
+				return;
538
+			}
539
+		}
540
+
541
+		static::reportInvalidArgument(sprintf(
542
+			$message ?: 'Expected an any of instance of this class or to this class among his parents other than %2$s. Got: %s',
543
+			static::typeToString($value),
544
+			\implode(', ', \array_map(array('static', 'valueToString'), $classes))
545
+		));
546
+	}
547
+
548
+	/**
549
+	 * @psalm-pure
550
+	 * @psalm-assert empty $value
551
+	 *
552
+	 * @param mixed  $value
553
+	 * @param string $message
554
+	 *
555
+	 * @throws InvalidArgumentException
556
+	 */
557
+	public static function isEmpty($value, $message = '')
558
+	{
559
+		if (!empty($value)) {
560
+			static::reportInvalidArgument(\sprintf(
561
+				$message ?: 'Expected an empty value. Got: %s',
562
+				static::valueToString($value)
563
+			));
564
+		}
565
+	}
566
+
567
+	/**
568
+	 * @psalm-pure
569
+	 * @psalm-assert !empty $value
570
+	 *
571
+	 * @param mixed  $value
572
+	 * @param string $message
573
+	 *
574
+	 * @throws InvalidArgumentException
575
+	 */
576
+	public static function notEmpty($value, $message = '')
577
+	{
578
+		if (empty($value)) {
579
+			static::reportInvalidArgument(\sprintf(
580
+				$message ?: 'Expected a non-empty value. Got: %s',
581
+				static::valueToString($value)
582
+			));
583
+		}
584
+	}
585
+
586
+	/**
587
+	 * @psalm-pure
588
+	 * @psalm-assert null $value
589
+	 *
590
+	 * @param mixed  $value
591
+	 * @param string $message
592
+	 *
593
+	 * @throws InvalidArgumentException
594
+	 */
595
+	public static function null($value, $message = '')
596
+	{
597
+		if (null !== $value) {
598
+			static::reportInvalidArgument(\sprintf(
599
+				$message ?: 'Expected null. Got: %s',
600
+				static::valueToString($value)
601
+			));
602
+		}
603
+	}
604
+
605
+	/**
606
+	 * @psalm-pure
607
+	 * @psalm-assert !null $value
608
+	 *
609
+	 * @param mixed  $value
610
+	 * @param string $message
611
+	 *
612
+	 * @throws InvalidArgumentException
613
+	 */
614
+	public static function notNull($value, $message = '')
615
+	{
616
+		if (null === $value) {
617
+			static::reportInvalidArgument(
618
+				$message ?: 'Expected a value other than null.'
619
+			);
620
+		}
621
+	}
622
+
623
+	/**
624
+	 * @psalm-pure
625
+	 * @psalm-assert true $value
626
+	 *
627
+	 * @param mixed  $value
628
+	 * @param string $message
629
+	 *
630
+	 * @throws InvalidArgumentException
631
+	 */
632
+	public static function true($value, $message = '')
633
+	{
634
+		if (true !== $value) {
635
+			static::reportInvalidArgument(\sprintf(
636
+				$message ?: 'Expected a value to be true. Got: %s',
637
+				static::valueToString($value)
638
+			));
639
+		}
640
+	}
641
+
642
+	/**
643
+	 * @psalm-pure
644
+	 * @psalm-assert false $value
645
+	 *
646
+	 * @param mixed  $value
647
+	 * @param string $message
648
+	 *
649
+	 * @throws InvalidArgumentException
650
+	 */
651
+	public static function false($value, $message = '')
652
+	{
653
+		if (false !== $value) {
654
+			static::reportInvalidArgument(\sprintf(
655
+				$message ?: 'Expected a value to be false. Got: %s',
656
+				static::valueToString($value)
657
+			));
658
+		}
659
+	}
660
+
661
+	/**
662
+	 * @psalm-pure
663
+	 * @psalm-assert !false $value
664
+	 *
665
+	 * @param mixed  $value
666
+	 * @param string $message
667
+	 *
668
+	 * @throws InvalidArgumentException
669
+	 */
670
+	public static function notFalse($value, $message = '')
671
+	{
672
+		if (false === $value) {
673
+			static::reportInvalidArgument(
674
+				$message ?: 'Expected a value other than false.'
675
+			);
676
+		}
677
+	}
678
+
679
+	/**
680
+	 * @param mixed  $value
681
+	 * @param string $message
682
+	 *
683
+	 * @throws InvalidArgumentException
684
+	 */
685
+	public static function ip($value, $message = '')
686
+	{
687
+		if (false === \filter_var($value, \FILTER_VALIDATE_IP)) {
688
+			static::reportInvalidArgument(\sprintf(
689
+				$message ?: 'Expected a value to be an IP. Got: %s',
690
+				static::valueToString($value)
691
+			));
692
+		}
693
+	}
694
+
695
+	/**
696
+	 * @param mixed  $value
697
+	 * @param string $message
698
+	 *
699
+	 * @throws InvalidArgumentException
700
+	 */
701
+	public static function ipv4($value, $message = '')
702
+	{
703
+		if (false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4)) {
704
+			static::reportInvalidArgument(\sprintf(
705
+				$message ?: 'Expected a value to be an IPv4. Got: %s',
706
+				static::valueToString($value)
707
+			));
708
+		}
709
+	}
710
+
711
+	/**
712
+	 * @param mixed  $value
713
+	 * @param string $message
714
+	 *
715
+	 * @throws InvalidArgumentException
716
+	 */
717
+	public static function ipv6($value, $message = '')
718
+	{
719
+		if (false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) {
720
+			static::reportInvalidArgument(\sprintf(
721
+				$message ?: 'Expected a value to be an IPv6. Got: %s',
722
+				static::valueToString($value)
723
+			));
724
+		}
725
+	}
726
+
727
+	/**
728
+	 * @param mixed  $value
729
+	 * @param string $message
730
+	 *
731
+	 * @throws InvalidArgumentException
732
+	 */
733
+	public static function email($value, $message = '')
734
+	{
735
+		if (false === \filter_var($value, FILTER_VALIDATE_EMAIL)) {
736
+			static::reportInvalidArgument(\sprintf(
737
+				$message ?: 'Expected a value to be a valid e-mail address. Got: %s',
738
+				static::valueToString($value)
739
+			));
740
+		}
741
+	}
742
+
743
+	/**
744
+	 * Does non strict comparisons on the items, so ['3', 3] will not pass the assertion.
745
+	 *
746
+	 * @param array  $values
747
+	 * @param string $message
748
+	 *
749
+	 * @throws InvalidArgumentException
750
+	 */
751
+	public static function uniqueValues(array $values, $message = '')
752
+	{
753
+		$allValues = \count($values);
754
+		$uniqueValues = \count(\array_unique($values));
755
+
756
+		if ($allValues !== $uniqueValues) {
757
+			$difference = $allValues - $uniqueValues;
758
+
759
+			static::reportInvalidArgument(\sprintf(
760
+				$message ?: 'Expected an array of unique values, but %s of them %s duplicated',
761
+				$difference,
762
+				(1 === $difference ? 'is' : 'are')
763
+			));
764
+		}
765
+	}
766
+
767
+	/**
768
+	 * @param mixed  $value
769
+	 * @param mixed  $expect
770
+	 * @param string $message
771
+	 *
772
+	 * @throws InvalidArgumentException
773
+	 */
774
+	public static function eq($value, $expect, $message = '')
775
+	{
776
+		if ($expect != $value) {
777
+			static::reportInvalidArgument(\sprintf(
778
+				$message ?: 'Expected a value equal to %2$s. Got: %s',
779
+				static::valueToString($value),
780
+				static::valueToString($expect)
781
+			));
782
+		}
783
+	}
784
+
785
+	/**
786
+	 * @param mixed  $value
787
+	 * @param mixed  $expect
788
+	 * @param string $message
789
+	 *
790
+	 * @throws InvalidArgumentException
791
+	 */
792
+	public static function notEq($value, $expect, $message = '')
793
+	{
794
+		if ($expect == $value) {
795
+			static::reportInvalidArgument(\sprintf(
796
+				$message ?: 'Expected a different value than %s.',
797
+				static::valueToString($expect)
798
+			));
799
+		}
800
+	}
801
+
802
+	/**
803
+	 * @psalm-pure
804
+	 *
805
+	 * @param mixed  $value
806
+	 * @param mixed  $expect
807
+	 * @param string $message
808
+	 *
809
+	 * @throws InvalidArgumentException
810
+	 */
811
+	public static function same($value, $expect, $message = '')
812
+	{
813
+		if ($expect !== $value) {
814
+			static::reportInvalidArgument(\sprintf(
815
+				$message ?: 'Expected a value identical to %2$s. Got: %s',
816
+				static::valueToString($value),
817
+				static::valueToString($expect)
818
+			));
819
+		}
820
+	}
821
+
822
+	/**
823
+	 * @psalm-pure
824
+	 *
825
+	 * @param mixed  $value
826
+	 * @param mixed  $expect
827
+	 * @param string $message
828
+	 *
829
+	 * @throws InvalidArgumentException
830
+	 */
831
+	public static function notSame($value, $expect, $message = '')
832
+	{
833
+		if ($expect === $value) {
834
+			static::reportInvalidArgument(\sprintf(
835
+				$message ?: 'Expected a value not identical to %s.',
836
+				static::valueToString($expect)
837
+			));
838
+		}
839
+	}
840
+
841
+	/**
842
+	 * @psalm-pure
843
+	 *
844
+	 * @param mixed  $value
845
+	 * @param mixed  $limit
846
+	 * @param string $message
847
+	 *
848
+	 * @throws InvalidArgumentException
849
+	 */
850
+	public static function greaterThan($value, $limit, $message = '')
851
+	{
852
+		if ($value <= $limit) {
853
+			static::reportInvalidArgument(\sprintf(
854
+				$message ?: 'Expected a value greater than %2$s. Got: %s',
855
+				static::valueToString($value),
856
+				static::valueToString($limit)
857
+			));
858
+		}
859
+	}
860
+
861
+	/**
862
+	 * @psalm-pure
863
+	 *
864
+	 * @param mixed  $value
865
+	 * @param mixed  $limit
866
+	 * @param string $message
867
+	 *
868
+	 * @throws InvalidArgumentException
869
+	 */
870
+	public static function greaterThanEq($value, $limit, $message = '')
871
+	{
872
+		if ($value < $limit) {
873
+			static::reportInvalidArgument(\sprintf(
874
+				$message ?: 'Expected a value greater than or equal to %2$s. Got: %s',
875
+				static::valueToString($value),
876
+				static::valueToString($limit)
877
+			));
878
+		}
879
+	}
880
+
881
+	/**
882
+	 * @psalm-pure
883
+	 *
884
+	 * @param mixed  $value
885
+	 * @param mixed  $limit
886
+	 * @param string $message
887
+	 *
888
+	 * @throws InvalidArgumentException
889
+	 */
890
+	public static function lessThan($value, $limit, $message = '')
891
+	{
892
+		if ($value >= $limit) {
893
+			static::reportInvalidArgument(\sprintf(
894
+				$message ?: 'Expected a value less than %2$s. Got: %s',
895
+				static::valueToString($value),
896
+				static::valueToString($limit)
897
+			));
898
+		}
899
+	}
900
+
901
+	/**
902
+	 * @psalm-pure
903
+	 *
904
+	 * @param mixed  $value
905
+	 * @param mixed  $limit
906
+	 * @param string $message
907
+	 *
908
+	 * @throws InvalidArgumentException
909
+	 */
910
+	public static function lessThanEq($value, $limit, $message = '')
911
+	{
912
+		if ($value > $limit) {
913
+			static::reportInvalidArgument(\sprintf(
914
+				$message ?: 'Expected a value less than or equal to %2$s. Got: %s',
915
+				static::valueToString($value),
916
+				static::valueToString($limit)
917
+			));
918
+		}
919
+	}
920
+
921
+	/**
922
+	 * Inclusive range, so Assert::(3, 3, 5) passes.
923
+	 *
924
+	 * @psalm-pure
925
+	 *
926
+	 * @param mixed  $value
927
+	 * @param mixed  $min
928
+	 * @param mixed  $max
929
+	 * @param string $message
930
+	 *
931
+	 * @throws InvalidArgumentException
932
+	 */
933
+	public static function range($value, $min, $max, $message = '')
934
+	{
935
+		if ($value < $min || $value > $max) {
936
+			static::reportInvalidArgument(\sprintf(
937
+				$message ?: 'Expected a value between %2$s and %3$s. Got: %s',
938
+				static::valueToString($value),
939
+				static::valueToString($min),
940
+				static::valueToString($max)
941
+			));
942
+		}
943
+	}
944
+
945
+	/**
946
+	 * A more human-readable alias of Assert::inArray().
947
+	 *
948
+	 * @psalm-pure
949
+	 *
950
+	 * @param mixed  $value
951
+	 * @param array  $values
952
+	 * @param string $message
953
+	 *
954
+	 * @throws InvalidArgumentException
955
+	 */
956
+	public static function oneOf($value, array $values, $message = '')
957
+	{
958
+		static::inArray($value, $values, $message);
959
+	}
960
+
961
+	/**
962
+	 * Does strict comparison, so Assert::inArray(3, ['3']) does not pass the assertion.
963
+	 *
964
+	 * @psalm-pure
965
+	 *
966
+	 * @param mixed  $value
967
+	 * @param array  $values
968
+	 * @param string $message
969
+	 *
970
+	 * @throws InvalidArgumentException
971
+	 */
972
+	public static function inArray($value, array $values, $message = '')
973
+	{
974
+		if (!\in_array($value, $values, true)) {
975
+			static::reportInvalidArgument(\sprintf(
976
+				$message ?: 'Expected one of: %2$s. Got: %s',
977
+				static::valueToString($value),
978
+				\implode(', ', \array_map(array('static', 'valueToString'), $values))
979
+			));
980
+		}
981
+	}
982
+
983
+	/**
984
+	 * @psalm-pure
985
+	 *
986
+	 * @param string $value
987
+	 * @param string $subString
988
+	 * @param string $message
989
+	 *
990
+	 * @throws InvalidArgumentException
991
+	 */
992
+	public static function contains($value, $subString, $message = '')
993
+	{
994
+		if (false === \strpos($value, $subString)) {
995
+			static::reportInvalidArgument(\sprintf(
996
+				$message ?: 'Expected a value to contain %2$s. Got: %s',
997
+				static::valueToString($value),
998
+				static::valueToString($subString)
999
+			));
1000
+		}
1001
+	}
1002
+
1003
+	/**
1004
+	 * @psalm-pure
1005
+	 *
1006
+	 * @param string $value
1007
+	 * @param string $subString
1008
+	 * @param string $message
1009
+	 *
1010
+	 * @throws InvalidArgumentException
1011
+	 */
1012
+	public static function notContains($value, $subString, $message = '')
1013
+	{
1014
+		if (false !== \strpos($value, $subString)) {
1015
+			static::reportInvalidArgument(\sprintf(
1016
+				$message ?: '%2$s was not expected to be contained in a value. Got: %s',
1017
+				static::valueToString($value),
1018
+				static::valueToString($subString)
1019
+			));
1020
+		}
1021
+	}
1022
+
1023
+	/**
1024
+	 * @psalm-pure
1025
+	 *
1026
+	 * @param string $value
1027
+	 * @param string $message
1028
+	 *
1029
+	 * @throws InvalidArgumentException
1030
+	 */
1031
+	public static function notWhitespaceOnly($value, $message = '')
1032
+	{
1033
+		if (\preg_match('/^\s*$/', $value)) {
1034
+			static::reportInvalidArgument(\sprintf(
1035
+				$message ?: 'Expected a non-whitespace string. Got: %s',
1036
+				static::valueToString($value)
1037
+			));
1038
+		}
1039
+	}
1040
+
1041
+	/**
1042
+	 * @psalm-pure
1043
+	 *
1044
+	 * @param string $value
1045
+	 * @param string $prefix
1046
+	 * @param string $message
1047
+	 *
1048
+	 * @throws InvalidArgumentException
1049
+	 */
1050
+	public static function startsWith($value, $prefix, $message = '')
1051
+	{
1052
+		if (0 !== \strpos($value, $prefix)) {
1053
+			static::reportInvalidArgument(\sprintf(
1054
+				$message ?: 'Expected a value to start with %2$s. Got: %s',
1055
+				static::valueToString($value),
1056
+				static::valueToString($prefix)
1057
+			));
1058
+		}
1059
+	}
1060
+
1061
+	/**
1062
+	 * @psalm-pure
1063
+	 *
1064
+	 * @param string $value
1065
+	 * @param string $prefix
1066
+	 * @param string $message
1067
+	 *
1068
+	 * @throws InvalidArgumentException
1069
+	 */
1070
+	public static function notStartsWith($value, $prefix, $message = '')
1071
+	{
1072
+		if (0 === \strpos($value, $prefix)) {
1073
+			static::reportInvalidArgument(\sprintf(
1074
+				$message ?: 'Expected a value not to start with %2$s. Got: %s',
1075
+				static::valueToString($value),
1076
+				static::valueToString($prefix)
1077
+			));
1078
+		}
1079
+	}
1080
+
1081
+	/**
1082
+	 * @psalm-pure
1083
+	 *
1084
+	 * @param mixed  $value
1085
+	 * @param string $message
1086
+	 *
1087
+	 * @throws InvalidArgumentException
1088
+	 */
1089
+	public static function startsWithLetter($value, $message = '')
1090
+	{
1091
+		static::string($value);
1092
+
1093
+		$valid = isset($value[0]);
1094
+
1095
+		if ($valid) {
1096
+			$locale = \setlocale(LC_CTYPE, 0);
1097
+			\setlocale(LC_CTYPE, 'C');
1098
+			$valid = \ctype_alpha($value[0]);
1099
+			\setlocale(LC_CTYPE, $locale);
1100
+		}
1101
+
1102
+		if (!$valid) {
1103
+			static::reportInvalidArgument(\sprintf(
1104
+				$message ?: 'Expected a value to start with a letter. Got: %s',
1105
+				static::valueToString($value)
1106
+			));
1107
+		}
1108
+	}
1109
+
1110
+	/**
1111
+	 * @psalm-pure
1112
+	 *
1113
+	 * @param string $value
1114
+	 * @param string $suffix
1115
+	 * @param string $message
1116
+	 *
1117
+	 * @throws InvalidArgumentException
1118
+	 */
1119
+	public static function endsWith($value, $suffix, $message = '')
1120
+	{
1121
+		if ($suffix !== \substr($value, -\strlen($suffix))) {
1122
+			static::reportInvalidArgument(\sprintf(
1123
+				$message ?: 'Expected a value to end with %2$s. Got: %s',
1124
+				static::valueToString($value),
1125
+				static::valueToString($suffix)
1126
+			));
1127
+		}
1128
+	}
1129
+
1130
+	/**
1131
+	 * @psalm-pure
1132
+	 *
1133
+	 * @param string $value
1134
+	 * @param string $suffix
1135
+	 * @param string $message
1136
+	 *
1137
+	 * @throws InvalidArgumentException
1138
+	 */
1139
+	public static function notEndsWith($value, $suffix, $message = '')
1140
+	{
1141
+		if ($suffix === \substr($value, -\strlen($suffix))) {
1142
+			static::reportInvalidArgument(\sprintf(
1143
+				$message ?: 'Expected a value not to end with %2$s. Got: %s',
1144
+				static::valueToString($value),
1145
+				static::valueToString($suffix)
1146
+			));
1147
+		}
1148
+	}
1149
+
1150
+	/**
1151
+	 * @psalm-pure
1152
+	 *
1153
+	 * @param string $value
1154
+	 * @param string $pattern
1155
+	 * @param string $message
1156
+	 *
1157
+	 * @throws InvalidArgumentException
1158
+	 */
1159
+	public static function regex($value, $pattern, $message = '')
1160
+	{
1161
+		if (!\preg_match($pattern, $value)) {
1162
+			static::reportInvalidArgument(\sprintf(
1163
+				$message ?: 'The value %s does not match the expected pattern.',
1164
+				static::valueToString($value)
1165
+			));
1166
+		}
1167
+	}
1168
+
1169
+	/**
1170
+	 * @psalm-pure
1171
+	 *
1172
+	 * @param string $value
1173
+	 * @param string $pattern
1174
+	 * @param string $message
1175
+	 *
1176
+	 * @throws InvalidArgumentException
1177
+	 */
1178
+	public static function notRegex($value, $pattern, $message = '')
1179
+	{
1180
+		if (\preg_match($pattern, $value, $matches, PREG_OFFSET_CAPTURE)) {
1181
+			static::reportInvalidArgument(\sprintf(
1182
+				$message ?: 'The value %s matches the pattern %s (at offset %d).',
1183
+				static::valueToString($value),
1184
+				static::valueToString($pattern),
1185
+				$matches[0][1]
1186
+			));
1187
+		}
1188
+	}
1189
+
1190
+	/**
1191
+	 * @psalm-pure
1192
+	 *
1193
+	 * @param mixed  $value
1194
+	 * @param string $message
1195
+	 *
1196
+	 * @throws InvalidArgumentException
1197
+	 */
1198
+	public static function unicodeLetters($value, $message = '')
1199
+	{
1200
+		static::string($value);
1201
+
1202
+		if (!\preg_match('/^\p{L}+$/u', $value)) {
1203
+			static::reportInvalidArgument(\sprintf(
1204
+				$message ?: 'Expected a value to contain only Unicode letters. Got: %s',
1205
+				static::valueToString($value)
1206
+			));
1207
+		}
1208
+	}
1209
+
1210
+	/**
1211
+	 * @psalm-pure
1212
+	 *
1213
+	 * @param mixed  $value
1214
+	 * @param string $message
1215
+	 *
1216
+	 * @throws InvalidArgumentException
1217
+	 */
1218
+	public static function alpha($value, $message = '')
1219
+	{
1220
+		static::string($value);
1221
+
1222
+		$locale = \setlocale(LC_CTYPE, 0);
1223
+		\setlocale(LC_CTYPE, 'C');
1224
+		$valid = !\ctype_alpha($value);
1225
+		\setlocale(LC_CTYPE, $locale);
1226
+
1227
+		if ($valid) {
1228
+			static::reportInvalidArgument(\sprintf(
1229
+				$message ?: 'Expected a value to contain only letters. Got: %s',
1230
+				static::valueToString($value)
1231
+			));
1232
+		}
1233
+	}
1234
+
1235
+	/**
1236
+	 * @psalm-pure
1237
+	 *
1238
+	 * @param string $value
1239
+	 * @param string $message
1240
+	 *
1241
+	 * @throws InvalidArgumentException
1242
+	 */
1243
+	public static function digits($value, $message = '')
1244
+	{
1245
+		$locale = \setlocale(LC_CTYPE, 0);
1246
+		\setlocale(LC_CTYPE, 'C');
1247
+		$valid = !\ctype_digit($value);
1248
+		\setlocale(LC_CTYPE, $locale);
1249
+
1250
+		if ($valid) {
1251
+			static::reportInvalidArgument(\sprintf(
1252
+				$message ?: 'Expected a value to contain digits only. Got: %s',
1253
+				static::valueToString($value)
1254
+			));
1255
+		}
1256
+	}
1257
+
1258
+	/**
1259
+	 * @psalm-pure
1260
+	 *
1261
+	 * @param string $value
1262
+	 * @param string $message
1263
+	 *
1264
+	 * @throws InvalidArgumentException
1265
+	 */
1266
+	public static function alnum($value, $message = '')
1267
+	{
1268
+		$locale = \setlocale(LC_CTYPE, 0);
1269
+		\setlocale(LC_CTYPE, 'C');
1270
+		$valid = !\ctype_alnum($value);
1271
+		\setlocale(LC_CTYPE, $locale);
1272
+
1273
+		if ($valid) {
1274
+			static::reportInvalidArgument(\sprintf(
1275
+				$message ?: 'Expected a value to contain letters and digits only. Got: %s',
1276
+				static::valueToString($value)
1277
+			));
1278
+		}
1279
+	}
1280
+
1281
+	/**
1282
+	 * @psalm-pure
1283
+	 * @psalm-assert lowercase-string $value
1284
+	 *
1285
+	 * @param string $value
1286
+	 * @param string $message
1287
+	 *
1288
+	 * @throws InvalidArgumentException
1289
+	 */
1290
+	public static function lower($value, $message = '')
1291
+	{
1292
+		$locale = \setlocale(LC_CTYPE, 0);
1293
+		\setlocale(LC_CTYPE, 'C');
1294
+		$valid = !\ctype_lower($value);
1295
+		\setlocale(LC_CTYPE, $locale);
1296
+
1297
+		if ($valid) {
1298
+			static::reportInvalidArgument(\sprintf(
1299
+				$message ?: 'Expected a value to contain lowercase characters only. Got: %s',
1300
+				static::valueToString($value)
1301
+			));
1302
+		}
1303
+	}
1304
+
1305
+	/**
1306
+	 * @psalm-pure
1307
+	 * @psalm-assert !lowercase-string $value
1308
+	 *
1309
+	 * @param string $value
1310
+	 * @param string $message
1311
+	 *
1312
+	 * @throws InvalidArgumentException
1313
+	 */
1314
+	public static function upper($value, $message = '')
1315
+	{
1316
+		$locale = \setlocale(LC_CTYPE, 0);
1317
+		\setlocale(LC_CTYPE, 'C');
1318
+		$valid = !\ctype_upper($value);
1319
+		\setlocale(LC_CTYPE, $locale);
1320
+
1321
+		if ($valid) {
1322
+			static::reportInvalidArgument(\sprintf(
1323
+				$message ?: 'Expected a value to contain uppercase characters only. Got: %s',
1324
+				static::valueToString($value)
1325
+			));
1326
+		}
1327
+	}
1328
+
1329
+	/**
1330
+	 * @psalm-pure
1331
+	 *
1332
+	 * @param string $value
1333
+	 * @param int    $length
1334
+	 * @param string $message
1335
+	 *
1336
+	 * @throws InvalidArgumentException
1337
+	 */
1338
+	public static function length($value, $length, $message = '')
1339
+	{
1340
+		if ($length !== static::strlen($value)) {
1341
+			static::reportInvalidArgument(\sprintf(
1342
+				$message ?: 'Expected a value to contain %2$s characters. Got: %s',
1343
+				static::valueToString($value),
1344
+				$length
1345
+			));
1346
+		}
1347
+	}
1348
+
1349
+	/**
1350
+	 * Inclusive min.
1351
+	 *
1352
+	 * @psalm-pure
1353
+	 *
1354
+	 * @param string    $value
1355
+	 * @param int|float $min
1356
+	 * @param string    $message
1357
+	 *
1358
+	 * @throws InvalidArgumentException
1359
+	 */
1360
+	public static function minLength($value, $min, $message = '')
1361
+	{
1362
+		if (static::strlen($value) < $min) {
1363
+			static::reportInvalidArgument(\sprintf(
1364
+				$message ?: 'Expected a value to contain at least %2$s characters. Got: %s',
1365
+				static::valueToString($value),
1366
+				$min
1367
+			));
1368
+		}
1369
+	}
1370
+
1371
+	/**
1372
+	 * Inclusive max.
1373
+	 *
1374
+	 * @psalm-pure
1375
+	 *
1376
+	 * @param string    $value
1377
+	 * @param int|float $max
1378
+	 * @param string    $message
1379
+	 *
1380
+	 * @throws InvalidArgumentException
1381
+	 */
1382
+	public static function maxLength($value, $max, $message = '')
1383
+	{
1384
+		if (static::strlen($value) > $max) {
1385
+			static::reportInvalidArgument(\sprintf(
1386
+				$message ?: 'Expected a value to contain at most %2$s characters. Got: %s',
1387
+				static::valueToString($value),
1388
+				$max
1389
+			));
1390
+		}
1391
+	}
1392
+
1393
+	/**
1394
+	 * Inclusive , so Assert::lengthBetween('asd', 3, 5); passes the assertion.
1395
+	 *
1396
+	 * @psalm-pure
1397
+	 *
1398
+	 * @param string    $value
1399
+	 * @param int|float $min
1400
+	 * @param int|float $max
1401
+	 * @param string    $message
1402
+	 *
1403
+	 * @throws InvalidArgumentException
1404
+	 */
1405
+	public static function lengthBetween($value, $min, $max, $message = '')
1406
+	{
1407
+		$length = static::strlen($value);
1408
+
1409
+		if ($length < $min || $length > $max) {
1410
+			static::reportInvalidArgument(\sprintf(
1411
+				$message ?: 'Expected a value to contain between %2$s and %3$s characters. Got: %s',
1412
+				static::valueToString($value),
1413
+				$min,
1414
+				$max
1415
+			));
1416
+		}
1417
+	}
1418
+
1419
+	/**
1420
+	 * Will also pass if $value is a directory, use Assert::file() instead if you need to be sure it is a file.
1421
+	 *
1422
+	 * @param mixed  $value
1423
+	 * @param string $message
1424
+	 *
1425
+	 * @throws InvalidArgumentException
1426
+	 */
1427
+	public static function fileExists($value, $message = '')
1428
+	{
1429
+		static::string($value);
1430
+
1431
+		if (!\file_exists($value)) {
1432
+			static::reportInvalidArgument(\sprintf(
1433
+				$message ?: 'The file %s does not exist.',
1434
+				static::valueToString($value)
1435
+			));
1436
+		}
1437
+	}
1438
+
1439
+	/**
1440
+	 * @param mixed  $value
1441
+	 * @param string $message
1442
+	 *
1443
+	 * @throws InvalidArgumentException
1444
+	 */
1445
+	public static function file($value, $message = '')
1446
+	{
1447
+		static::fileExists($value, $message);
1448
+
1449
+		if (!\is_file($value)) {
1450
+			static::reportInvalidArgument(\sprintf(
1451
+				$message ?: 'The path %s is not a file.',
1452
+				static::valueToString($value)
1453
+			));
1454
+		}
1455
+	}
1456
+
1457
+	/**
1458
+	 * @param mixed  $value
1459
+	 * @param string $message
1460
+	 *
1461
+	 * @throws InvalidArgumentException
1462
+	 */
1463
+	public static function directory($value, $message = '')
1464
+	{
1465
+		static::fileExists($value, $message);
1466
+
1467
+		if (!\is_dir($value)) {
1468
+			static::reportInvalidArgument(\sprintf(
1469
+				$message ?: 'The path %s is no directory.',
1470
+				static::valueToString($value)
1471
+			));
1472
+		}
1473
+	}
1474
+
1475
+	/**
1476
+	 * @param string $value
1477
+	 * @param string $message
1478
+	 *
1479
+	 * @throws InvalidArgumentException
1480
+	 */
1481
+	public static function readable($value, $message = '')
1482
+	{
1483
+		if (!\is_readable($value)) {
1484
+			static::reportInvalidArgument(\sprintf(
1485
+				$message ?: 'The path %s is not readable.',
1486
+				static::valueToString($value)
1487
+			));
1488
+		}
1489
+	}
1490
+
1491
+	/**
1492
+	 * @param string $value
1493
+	 * @param string $message
1494
+	 *
1495
+	 * @throws InvalidArgumentException
1496
+	 */
1497
+	public static function writable($value, $message = '')
1498
+	{
1499
+		if (!\is_writable($value)) {
1500
+			static::reportInvalidArgument(\sprintf(
1501
+				$message ?: 'The path %s is not writable.',
1502
+				static::valueToString($value)
1503
+			));
1504
+		}
1505
+	}
1506
+
1507
+	/**
1508
+	 * @psalm-assert class-string $value
1509
+	 *
1510
+	 * @param mixed  $value
1511
+	 * @param string $message
1512
+	 *
1513
+	 * @throws InvalidArgumentException
1514
+	 */
1515
+	public static function classExists($value, $message = '')
1516
+	{
1517
+		if (!\class_exists($value)) {
1518
+			static::reportInvalidArgument(\sprintf(
1519
+				$message ?: 'Expected an existing class name. Got: %s',
1520
+				static::valueToString($value)
1521
+			));
1522
+		}
1523
+	}
1524
+
1525
+	/**
1526
+	 * @psalm-pure
1527
+	 * @psalm-template ExpectedType of object
1528
+	 * @psalm-param class-string<ExpectedType> $class
1529
+	 * @psalm-assert class-string<ExpectedType>|ExpectedType $value
1530
+	 *
1531
+	 * @param mixed         $value
1532
+	 * @param string|object $class
1533
+	 * @param string        $message
1534
+	 *
1535
+	 * @throws InvalidArgumentException
1536
+	 */
1537
+	public static function subclassOf($value, $class, $message = '')
1538
+	{
1539
+		if (!\is_subclass_of($value, $class)) {
1540
+			static::reportInvalidArgument(\sprintf(
1541
+				$message ?: 'Expected a sub-class of %2$s. Got: %s',
1542
+				static::valueToString($value),
1543
+				static::valueToString($class)
1544
+			));
1545
+		}
1546
+	}
1547
+
1548
+	/**
1549
+	 * @psalm-assert class-string $value
1550
+	 *
1551
+	 * @param mixed  $value
1552
+	 * @param string $message
1553
+	 *
1554
+	 * @throws InvalidArgumentException
1555
+	 */
1556
+	public static function interfaceExists($value, $message = '')
1557
+	{
1558
+		if (!\interface_exists($value)) {
1559
+			static::reportInvalidArgument(\sprintf(
1560
+				$message ?: 'Expected an existing interface name. got %s',
1561
+				static::valueToString($value)
1562
+			));
1563
+		}
1564
+	}
1565
+
1566
+	/**
1567
+	 * @psalm-pure
1568
+	 * @psalm-template ExpectedType of object
1569
+	 * @psalm-param class-string<ExpectedType> $interface
1570
+	 * @psalm-assert class-string<ExpectedType> $value
1571
+	 *
1572
+	 * @param mixed  $value
1573
+	 * @param mixed  $interface
1574
+	 * @param string $message
1575
+	 *
1576
+	 * @throws InvalidArgumentException
1577
+	 */
1578
+	public static function implementsInterface($value, $interface, $message = '')
1579
+	{
1580
+		if (!\in_array($interface, \class_implements($value))) {
1581
+			static::reportInvalidArgument(\sprintf(
1582
+				$message ?: 'Expected an implementation of %2$s. Got: %s',
1583
+				static::valueToString($value),
1584
+				static::valueToString($interface)
1585
+			));
1586
+		}
1587
+	}
1588
+
1589
+	/**
1590
+	 * @psalm-pure
1591
+	 * @psalm-param class-string|object $classOrObject
1592
+	 *
1593
+	 * @param string|object $classOrObject
1594
+	 * @param mixed         $property
1595
+	 * @param string        $message
1596
+	 *
1597
+	 * @throws InvalidArgumentException
1598
+	 */
1599
+	public static function propertyExists($classOrObject, $property, $message = '')
1600
+	{
1601
+		if (!\property_exists($classOrObject, $property)) {
1602
+			static::reportInvalidArgument(\sprintf(
1603
+				$message ?: 'Expected the property %s to exist.',
1604
+				static::valueToString($property)
1605
+			));
1606
+		}
1607
+	}
1608
+
1609
+	/**
1610
+	 * @psalm-pure
1611
+	 * @psalm-param class-string|object $classOrObject
1612
+	 *
1613
+	 * @param string|object $classOrObject
1614
+	 * @param mixed         $property
1615
+	 * @param string        $message
1616
+	 *
1617
+	 * @throws InvalidArgumentException
1618
+	 */
1619
+	public static function propertyNotExists($classOrObject, $property, $message = '')
1620
+	{
1621
+		if (\property_exists($classOrObject, $property)) {
1622
+			static::reportInvalidArgument(\sprintf(
1623
+				$message ?: 'Expected the property %s to not exist.',
1624
+				static::valueToString($property)
1625
+			));
1626
+		}
1627
+	}
1628
+
1629
+	/**
1630
+	 * @psalm-pure
1631
+	 * @psalm-param class-string|object $classOrObject
1632
+	 *
1633
+	 * @param string|object $classOrObject
1634
+	 * @param mixed         $method
1635
+	 * @param string        $message
1636
+	 *
1637
+	 * @throws InvalidArgumentException
1638
+	 */
1639
+	public static function methodExists($classOrObject, $method, $message = '')
1640
+	{
1641
+		if (!(\is_string($classOrObject) || \is_object($classOrObject)) || !\method_exists($classOrObject, $method)) {
1642
+			static::reportInvalidArgument(\sprintf(
1643
+				$message ?: 'Expected the method %s to exist.',
1644
+				static::valueToString($method)
1645
+			));
1646
+		}
1647
+	}
1648
+
1649
+	/**
1650
+	 * @psalm-pure
1651
+	 * @psalm-param class-string|object $classOrObject
1652
+	 *
1653
+	 * @param string|object $classOrObject
1654
+	 * @param mixed         $method
1655
+	 * @param string        $message
1656
+	 *
1657
+	 * @throws InvalidArgumentException
1658
+	 */
1659
+	public static function methodNotExists($classOrObject, $method, $message = '')
1660
+	{
1661
+		if ((\is_string($classOrObject) || \is_object($classOrObject)) && \method_exists($classOrObject, $method)) {
1662
+			static::reportInvalidArgument(\sprintf(
1663
+				$message ?: 'Expected the method %s to not exist.',
1664
+				static::valueToString($method)
1665
+			));
1666
+		}
1667
+	}
1668
+
1669
+	/**
1670
+	 * @psalm-pure
1671
+	 *
1672
+	 * @param array      $array
1673
+	 * @param string|int $key
1674
+	 * @param string     $message
1675
+	 *
1676
+	 * @throws InvalidArgumentException
1677
+	 */
1678
+	public static function keyExists($array, $key, $message = '')
1679
+	{
1680
+		if (!(isset($array[$key]) || \array_key_exists($key, $array))) {
1681
+			static::reportInvalidArgument(\sprintf(
1682
+				$message ?: 'Expected the key %s to exist.',
1683
+				static::valueToString($key)
1684
+			));
1685
+		}
1686
+	}
1687
+
1688
+	/**
1689
+	 * @psalm-pure
1690
+	 *
1691
+	 * @param array      $array
1692
+	 * @param string|int $key
1693
+	 * @param string     $message
1694
+	 *
1695
+	 * @throws InvalidArgumentException
1696
+	 */
1697
+	public static function keyNotExists($array, $key, $message = '')
1698
+	{
1699
+		if (isset($array[$key]) || \array_key_exists($key, $array)) {
1700
+			static::reportInvalidArgument(\sprintf(
1701
+				$message ?: 'Expected the key %s to not exist.',
1702
+				static::valueToString($key)
1703
+			));
1704
+		}
1705
+	}
1706
+
1707
+	/**
1708
+	 * Checks if a value is a valid array key (int or string).
1709
+	 *
1710
+	 * @psalm-pure
1711
+	 * @psalm-assert array-key $value
1712
+	 *
1713
+	 * @param mixed  $value
1714
+	 * @param string $message
1715
+	 *
1716
+	 * @throws InvalidArgumentException
1717
+	 */
1718
+	public static function validArrayKey($value, $message = '')
1719
+	{
1720
+		if (!(\is_int($value) || \is_string($value))) {
1721
+			static::reportInvalidArgument(\sprintf(
1722
+				$message ?: 'Expected string or integer. Got: %s',
1723
+				static::typeToString($value)
1724
+			));
1725
+		}
1726
+	}
1727
+
1728
+	/**
1729
+	 * Does not check if $array is countable, this can generate a warning on php versions after 7.2.
1730
+	 *
1731
+	 * @param Countable|array $array
1732
+	 * @param int             $number
1733
+	 * @param string          $message
1734
+	 *
1735
+	 * @throws InvalidArgumentException
1736
+	 */
1737
+	public static function count($array, $number, $message = '')
1738
+	{
1739
+		static::eq(
1740
+			\count($array),
1741
+			$number,
1742
+			\sprintf(
1743
+				$message ?: 'Expected an array to contain %d elements. Got: %d.',
1744
+				$number,
1745
+				\count($array)
1746
+			)
1747
+		);
1748
+	}
1749
+
1750
+	/**
1751
+	 * Does not check if $array is countable, this can generate a warning on php versions after 7.2.
1752
+	 *
1753
+	 * @param Countable|array $array
1754
+	 * @param int|float       $min
1755
+	 * @param string          $message
1756
+	 *
1757
+	 * @throws InvalidArgumentException
1758
+	 */
1759
+	public static function minCount($array, $min, $message = '')
1760
+	{
1761
+		if (\count($array) < $min) {
1762
+			static::reportInvalidArgument(\sprintf(
1763
+				$message ?: 'Expected an array to contain at least %2$d elements. Got: %d',
1764
+				\count($array),
1765
+				$min
1766
+			));
1767
+		}
1768
+	}
1769
+
1770
+	/**
1771
+	 * Does not check if $array is countable, this can generate a warning on php versions after 7.2.
1772
+	 *
1773
+	 * @param Countable|array $array
1774
+	 * @param int|float       $max
1775
+	 * @param string          $message
1776
+	 *
1777
+	 * @throws InvalidArgumentException
1778
+	 */
1779
+	public static function maxCount($array, $max, $message = '')
1780
+	{
1781
+		if (\count($array) > $max) {
1782
+			static::reportInvalidArgument(\sprintf(
1783
+				$message ?: 'Expected an array to contain at most %2$d elements. Got: %d',
1784
+				\count($array),
1785
+				$max
1786
+			));
1787
+		}
1788
+	}
1789
+
1790
+	/**
1791
+	 * Does not check if $array is countable, this can generate a warning on php versions after 7.2.
1792
+	 *
1793
+	 * @param Countable|array $array
1794
+	 * @param int|float       $min
1795
+	 * @param int|float       $max
1796
+	 * @param string          $message
1797
+	 *
1798
+	 * @throws InvalidArgumentException
1799
+	 */
1800
+	public static function countBetween($array, $min, $max, $message = '')
1801
+	{
1802
+		$count = \count($array);
1803
+
1804
+		if ($count < $min || $count > $max) {
1805
+			static::reportInvalidArgument(\sprintf(
1806
+				$message ?: 'Expected an array to contain between %2$d and %3$d elements. Got: %d',
1807
+				$count,
1808
+				$min,
1809
+				$max
1810
+			));
1811
+		}
1812
+	}
1813
+
1814
+	/**
1815
+	 * @psalm-pure
1816
+	 * @psalm-assert list $array
1817
+	 *
1818
+	 * @param mixed  $array
1819
+	 * @param string $message
1820
+	 *
1821
+	 * @throws InvalidArgumentException
1822
+	 */
1823
+	public static function isList($array, $message = '')
1824
+	{
1825
+		if (!\is_array($array) || $array !== \array_values($array)) {
1826
+			static::reportInvalidArgument(
1827
+				$message ?: 'Expected list - non-associative array.'
1828
+			);
1829
+		}
1830
+	}
1831
+
1832
+	/**
1833
+	 * @psalm-pure
1834
+	 * @psalm-assert non-empty-list $array
1835
+	 *
1836
+	 * @param mixed  $array
1837
+	 * @param string $message
1838
+	 *
1839
+	 * @throws InvalidArgumentException
1840
+	 */
1841
+	public static function isNonEmptyList($array, $message = '')
1842
+	{
1843
+		static::isList($array, $message);
1844
+		static::notEmpty($array, $message);
1845
+	}
1846
+
1847
+	/**
1848
+	 * @psalm-pure
1849
+	 * @psalm-template T
1850
+	 * @psalm-param mixed|array<T> $array
1851
+	 * @psalm-assert array<string, T> $array
1852
+	 *
1853
+	 * @param mixed  $array
1854
+	 * @param string $message
1855
+	 *
1856
+	 * @throws InvalidArgumentException
1857
+	 */
1858
+	public static function isMap($array, $message = '')
1859
+	{
1860
+		if (
1861
+			!\is_array($array) ||
1862
+			\array_keys($array) !== \array_filter(\array_keys($array), '\is_string')
1863
+		) {
1864
+			static::reportInvalidArgument(
1865
+				$message ?: 'Expected map - associative array with string keys.'
1866
+			);
1867
+		}
1868
+	}
1869
+
1870
+	/**
1871
+	 * @psalm-pure
1872
+	 * @psalm-template T
1873
+	 * @psalm-param mixed|array<T> $array
1874
+	 * @psalm-assert array<string, T> $array
1875
+	 * @psalm-assert !empty $array
1876
+	 *
1877
+	 * @param mixed  $array
1878
+	 * @param string $message
1879
+	 *
1880
+	 * @throws InvalidArgumentException
1881
+	 */
1882
+	public static function isNonEmptyMap($array, $message = '')
1883
+	{
1884
+		static::isMap($array, $message);
1885
+		static::notEmpty($array, $message);
1886
+	}
1887
+
1888
+	/**
1889
+	 * @psalm-pure
1890
+	 *
1891
+	 * @param string $value
1892
+	 * @param string $message
1893
+	 *
1894
+	 * @throws InvalidArgumentException
1895
+	 */
1896
+	public static function uuid($value, $message = '')
1897
+	{
1898
+		$value = \str_replace(array('urn:', 'uuid:', '{', '}'), '', $value);
1899
+
1900
+		// The nil UUID is special form of UUID that is specified to have all
1901
+		// 128 bits set to zero.
1902
+		if ('00000000-0000-0000-0000-000000000000' === $value) {
1903
+			return;
1904
+		}
1905
+
1906
+		if (!\preg_match('/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/', $value)) {
1907
+			static::reportInvalidArgument(\sprintf(
1908
+				$message ?: 'Value %s is not a valid UUID.',
1909
+				static::valueToString($value)
1910
+			));
1911
+		}
1912
+	}
1913
+
1914
+	/**
1915
+	 * @psalm-param class-string<Throwable> $class
1916
+	 *
1917
+	 * @param Closure $expression
1918
+	 * @param string  $class
1919
+	 * @param string  $message
1920
+	 *
1921
+	 * @throws InvalidArgumentException
1922
+	 */
1923
+	public static function throws(Closure $expression, $class = 'Exception', $message = '')
1924
+	{
1925
+		static::string($class);
1926
+
1927
+		$actual = 'none';
1928
+
1929
+		try {
1930
+			$expression();
1931
+		} catch (Exception $e) {
1932
+			$actual = \get_class($e);
1933
+			if ($e instanceof $class) {
1934
+				return;
1935
+			}
1936
+		} catch (Throwable $e) {
1937
+			$actual = \get_class($e);
1938
+			if ($e instanceof $class) {
1939
+				return;
1940
+			}
1941
+		}
1942
+
1943
+		static::reportInvalidArgument($message ?: \sprintf(
1944
+			'Expected to throw "%s", got "%s"',
1945
+			$class,
1946
+			$actual
1947
+		));
1948
+	}
1949
+
1950
+	/**
1951
+	 * @throws BadMethodCallException
1952
+	 */
1953
+	public static function __callStatic($name, $arguments)
1954
+	{
1955
+		if ('nullOr' === \substr($name, 0, 6)) {
1956
+			if (null !== $arguments[0]) {
1957
+				$method = \lcfirst(\substr($name, 6));
1958
+				\call_user_func_array(array('static', $method), $arguments);
1959
+			}
1960
+
1961
+			return;
1962
+		}
1963
+
1964
+		if ('all' === \substr($name, 0, 3)) {
1965
+			static::isIterable($arguments[0]);
1966
+
1967
+			$method = \lcfirst(\substr($name, 3));
1968
+			$args = $arguments;
1969
+
1970
+			foreach ($arguments[0] as $entry) {
1971
+				$args[0] = $entry;
1972
+
1973
+				\call_user_func_array(array('static', $method), $args);
1974
+			}
1975
+
1976
+			return;
1977
+		}
1978
+
1979
+		throw new BadMethodCallException('No such method: '.$name);
1980
+	}
1981
+
1982
+	/**
1983
+	 * @param mixed $value
1984
+	 *
1985
+	 * @return string
1986
+	 */
1987
+	protected static function valueToString($value)
1988
+	{
1989
+		if (null === $value) {
1990
+			return 'null';
1991
+		}
1992
+
1993
+		if (true === $value) {
1994
+			return 'true';
1995
+		}
1996
+
1997
+		if (false === $value) {
1998
+			return 'false';
1999
+		}
2000
+
2001
+		if (\is_array($value)) {
2002
+			return 'array';
2003
+		}
2004
+
2005
+		if (\is_object($value)) {
2006
+			if (\method_exists($value, '__toString')) {
2007
+				return \get_class($value).': '.self::valueToString($value->__toString());
2008
+			}
2009
+
2010
+			if ($value instanceof DateTime || $value instanceof DateTimeImmutable) {
2011
+				return \get_class($value).': '.self::valueToString($value->format('c'));
2012
+			}
2013
+
2014
+			return \get_class($value);
2015
+		}
2016
+
2017
+		if (\is_resource($value)) {
2018
+			return 'resource';
2019
+		}
2020
+
2021
+		if (\is_string($value)) {
2022
+			return '"'.$value.'"';
2023
+		}
2024
+
2025
+		return (string) $value;
2026
+	}
2027
+
2028
+	/**
2029
+	 * @param mixed $value
2030
+	 *
2031
+	 * @return string
2032
+	 */
2033
+	protected static function typeToString($value)
2034
+	{
2035
+		return \is_object($value) ? \get_class($value) : \gettype($value);
2036
+	}
2037
+
2038
+	protected static function strlen($value)
2039
+	{
2040
+		if (!\function_exists('mb_detect_encoding')) {
2041
+			return \strlen($value);
2042
+		}
2043
+
2044
+		if (false === $encoding = \mb_detect_encoding($value)) {
2045
+			return \strlen($value);
2046
+		}
2047
+
2048
+		return \mb_strlen($value, $encoding);
2049
+	}
2050
+
2051
+	/**
2052
+	 * @param string $message
2053
+	 *
2054
+	 * @throws InvalidArgumentException
2055
+	 *
2056
+	 * @psalm-pure this method is not supposed to perform side-effects
2057
+	 */
2058
+	protected static function reportInvalidArgument($message)
2059
+	{
2060
+		throw new InvalidArgumentException($message);
2061
+	}
2062
+
2063
+	private function __construct()
2064
+	{
2065
+	}
2066 2066
 }
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public static function string($value, $message = '')
47 47
     {
48
-        if (!\is_string($value)) {
48
+        if ( ! \is_string($value)) {
49 49
             static::reportInvalidArgument(\sprintf(
50 50
                 $message ?: 'Expected a string. Got: %s',
51 51
                 static::typeToString($value)
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public static function integer($value, $message = '')
81 81
     {
82
-        if (!\is_int($value)) {
82
+        if ( ! \is_int($value)) {
83 83
             static::reportInvalidArgument(\sprintf(
84 84
                 $message ?: 'Expected an integer. Got: %s',
85 85
                 static::typeToString($value)
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public static function integerish($value, $message = '')
100 100
     {
101
-        if (!\is_numeric($value) || $value != (int) $value) {
101
+        if ( ! \is_numeric($value) || $value != (int) $value) {
102 102
             static::reportInvalidArgument(\sprintf(
103 103
                 $message ?: 'Expected an integerish value. Got: %s',
104 104
                 static::typeToString($value)
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      */
118 118
     public static function positiveInteger($value, $message = '')
119 119
     {
120
-        if (!(\is_int($value) && $value > 0)) {
120
+        if ( ! (\is_int($value) && $value > 0)) {
121 121
             static::reportInvalidArgument(\sprintf(
122 122
                 $message ?: 'Expected a positive integer. Got: %s',
123 123
                 static::valueToString($value)
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     public static function float($value, $message = '')
138 138
     {
139
-        if (!\is_float($value)) {
139
+        if ( ! \is_float($value)) {
140 140
             static::reportInvalidArgument(\sprintf(
141 141
                 $message ?: 'Expected a float. Got: %s',
142 142
                 static::typeToString($value)
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      */
156 156
     public static function numeric($value, $message = '')
157 157
     {
158
-        if (!\is_numeric($value)) {
158
+        if ( ! \is_numeric($value)) {
159 159
             static::reportInvalidArgument(\sprintf(
160 160
                 $message ?: 'Expected a numeric. Got: %s',
161 161
                 static::typeToString($value)
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      */
175 175
     public static function natural($value, $message = '')
176 176
     {
177
-        if (!\is_int($value) || $value < 0) {
177
+        if ( ! \is_int($value) || $value < 0) {
178 178
             static::reportInvalidArgument(\sprintf(
179 179
                 $message ?: 'Expected a non-negative integer. Got: %s',
180 180
                 static::valueToString($value)
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      */
194 194
     public static function boolean($value, $message = '')
195 195
     {
196
-        if (!\is_bool($value)) {
196
+        if ( ! \is_bool($value)) {
197 197
             static::reportInvalidArgument(\sprintf(
198 198
                 $message ?: 'Expected a boolean. Got: %s',
199 199
                 static::typeToString($value)
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
      */
213 213
     public static function scalar($value, $message = '')
214 214
     {
215
-        if (!\is_scalar($value)) {
215
+        if ( ! \is_scalar($value)) {
216 216
             static::reportInvalidArgument(\sprintf(
217 217
                 $message ?: 'Expected a scalar. Got: %s',
218 218
                 static::typeToString($value)
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
      */
232 232
     public static function object($value, $message = '')
233 233
     {
234
-        if (!\is_object($value)) {
234
+        if ( ! \is_object($value)) {
235 235
             static::reportInvalidArgument(\sprintf(
236 236
                 $message ?: 'Expected an object. Got: %s',
237 237
                 static::typeToString($value)
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
      */
252 252
     public static function resource($value, $type = null, $message = '')
253 253
     {
254
-        if (!\is_resource($value)) {
254
+        if ( ! \is_resource($value)) {
255 255
             static::reportInvalidArgument(\sprintf(
256 256
                 $message ?: 'Expected a resource. Got: %s',
257 257
                 static::typeToString($value)
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
      */
279 279
     public static function isCallable($value, $message = '')
280 280
     {
281
-        if (!\is_callable($value)) {
281
+        if ( ! \is_callable($value)) {
282 282
             static::reportInvalidArgument(\sprintf(
283 283
                 $message ?: 'Expected a callable. Got: %s',
284 284
                 static::typeToString($value)
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
      */
298 298
     public static function isArray($value, $message = '')
299 299
     {
300
-        if (!\is_array($value)) {
300
+        if ( ! \is_array($value)) {
301 301
             static::reportInvalidArgument(\sprintf(
302 302
                 $message ?: 'Expected an array. Got: %s',
303 303
                 static::typeToString($value)
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
             \E_USER_DEPRECATED
327 327
         );
328 328
 
329
-        if (!\is_array($value) && !($value instanceof Traversable)) {
329
+        if ( ! \is_array($value) && ! ($value instanceof Traversable)) {
330 330
             static::reportInvalidArgument(\sprintf(
331 331
                 $message ?: 'Expected a traversable. Got: %s',
332 332
                 static::typeToString($value)
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
      */
346 346
     public static function isArrayAccessible($value, $message = '')
347 347
     {
348
-        if (!\is_array($value) && !($value instanceof ArrayAccess)) {
348
+        if ( ! \is_array($value) && ! ($value instanceof ArrayAccess)) {
349 349
             static::reportInvalidArgument(\sprintf(
350 350
                 $message ?: 'Expected an array accessible. Got: %s',
351 351
                 static::typeToString($value)
@@ -365,10 +365,10 @@  discard block
 block discarded – undo
365 365
     public static function isCountable($value, $message = '')
366 366
     {
367 367
         if (
368
-            !\is_array($value)
369
-            && !($value instanceof Countable)
370
-            && !($value instanceof ResourceBundle)
371
-            && !($value instanceof SimpleXMLElement)
368
+            ! \is_array($value)
369
+            && ! ($value instanceof Countable)
370
+            && ! ($value instanceof ResourceBundle)
371
+            && ! ($value instanceof SimpleXMLElement)
372 372
         ) {
373 373
             static::reportInvalidArgument(\sprintf(
374 374
                 $message ?: 'Expected a countable. Got: %s',
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
      */
389 389
     public static function isIterable($value, $message = '')
390 390
     {
391
-        if (!\is_array($value) && !($value instanceof Traversable)) {
391
+        if ( ! \is_array($value) && ! ($value instanceof Traversable)) {
392 392
             static::reportInvalidArgument(\sprintf(
393 393
                 $message ?: 'Expected an iterable. Got: %s',
394 394
                 static::typeToString($value)
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
      */
411 411
     public static function isInstanceOf($value, $class, $message = '')
412 412
     {
413
-        if (!($value instanceof $class)) {
413
+        if ( ! ($value instanceof $class)) {
414 414
             static::reportInvalidArgument(\sprintf(
415 415
                 $message ?: 'Expected an instance of %2$s. Got: %s',
416 416
                 static::typeToString($value),
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
     {
484 484
         static::string($class, 'Expected class as a string. Got: %s');
485 485
 
486
-        if (!\is_a($value, $class, \is_string($value))) {
486
+        if ( ! \is_a($value, $class, \is_string($value))) {
487 487
             static::reportInvalidArgument(sprintf(
488 488
                 $message ?: 'Expected an instance of this class or to this class among his parents %2$s. Got: %s',
489 489
                 static::typeToString($value),
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
      */
557 557
     public static function isEmpty($value, $message = '')
558 558
     {
559
-        if (!empty($value)) {
559
+        if ( ! empty($value)) {
560 560
             static::reportInvalidArgument(\sprintf(
561 561
                 $message ?: 'Expected an empty value. Got: %s',
562 562
                 static::valueToString($value)
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
      */
972 972
     public static function inArray($value, array $values, $message = '')
973 973
     {
974
-        if (!\in_array($value, $values, true)) {
974
+        if ( ! \in_array($value, $values, true)) {
975 975
             static::reportInvalidArgument(\sprintf(
976 976
                 $message ?: 'Expected one of: %2$s. Got: %s',
977 977
                 static::valueToString($value),
@@ -1099,7 +1099,7 @@  discard block
 block discarded – undo
1099 1099
             \setlocale(LC_CTYPE, $locale);
1100 1100
         }
1101 1101
 
1102
-        if (!$valid) {
1102
+        if ( ! $valid) {
1103 1103
             static::reportInvalidArgument(\sprintf(
1104 1104
                 $message ?: 'Expected a value to start with a letter. Got: %s',
1105 1105
                 static::valueToString($value)
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
      */
1159 1159
     public static function regex($value, $pattern, $message = '')
1160 1160
     {
1161
-        if (!\preg_match($pattern, $value)) {
1161
+        if ( ! \preg_match($pattern, $value)) {
1162 1162
             static::reportInvalidArgument(\sprintf(
1163 1163
                 $message ?: 'The value %s does not match the expected pattern.',
1164 1164
                 static::valueToString($value)
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
     {
1200 1200
         static::string($value);
1201 1201
 
1202
-        if (!\preg_match('/^\p{L}+$/u', $value)) {
1202
+        if ( ! \preg_match('/^\p{L}+$/u', $value)) {
1203 1203
             static::reportInvalidArgument(\sprintf(
1204 1204
                 $message ?: 'Expected a value to contain only Unicode letters. Got: %s',
1205 1205
                 static::valueToString($value)
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
 
1222 1222
         $locale = \setlocale(LC_CTYPE, 0);
1223 1223
         \setlocale(LC_CTYPE, 'C');
1224
-        $valid = !\ctype_alpha($value);
1224
+        $valid = ! \ctype_alpha($value);
1225 1225
         \setlocale(LC_CTYPE, $locale);
1226 1226
 
1227 1227
         if ($valid) {
@@ -1244,7 +1244,7 @@  discard block
 block discarded – undo
1244 1244
     {
1245 1245
         $locale = \setlocale(LC_CTYPE, 0);
1246 1246
         \setlocale(LC_CTYPE, 'C');
1247
-        $valid = !\ctype_digit($value);
1247
+        $valid = ! \ctype_digit($value);
1248 1248
         \setlocale(LC_CTYPE, $locale);
1249 1249
 
1250 1250
         if ($valid) {
@@ -1267,7 +1267,7 @@  discard block
 block discarded – undo
1267 1267
     {
1268 1268
         $locale = \setlocale(LC_CTYPE, 0);
1269 1269
         \setlocale(LC_CTYPE, 'C');
1270
-        $valid = !\ctype_alnum($value);
1270
+        $valid = ! \ctype_alnum($value);
1271 1271
         \setlocale(LC_CTYPE, $locale);
1272 1272
 
1273 1273
         if ($valid) {
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
     {
1292 1292
         $locale = \setlocale(LC_CTYPE, 0);
1293 1293
         \setlocale(LC_CTYPE, 'C');
1294
-        $valid = !\ctype_lower($value);
1294
+        $valid = ! \ctype_lower($value);
1295 1295
         \setlocale(LC_CTYPE, $locale);
1296 1296
 
1297 1297
         if ($valid) {
@@ -1315,7 +1315,7 @@  discard block
 block discarded – undo
1315 1315
     {
1316 1316
         $locale = \setlocale(LC_CTYPE, 0);
1317 1317
         \setlocale(LC_CTYPE, 'C');
1318
-        $valid = !\ctype_upper($value);
1318
+        $valid = ! \ctype_upper($value);
1319 1319
         \setlocale(LC_CTYPE, $locale);
1320 1320
 
1321 1321
         if ($valid) {
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
     {
1429 1429
         static::string($value);
1430 1430
 
1431
-        if (!\file_exists($value)) {
1431
+        if ( ! \file_exists($value)) {
1432 1432
             static::reportInvalidArgument(\sprintf(
1433 1433
                 $message ?: 'The file %s does not exist.',
1434 1434
                 static::valueToString($value)
@@ -1446,7 +1446,7 @@  discard block
 block discarded – undo
1446 1446
     {
1447 1447
         static::fileExists($value, $message);
1448 1448
 
1449
-        if (!\is_file($value)) {
1449
+        if ( ! \is_file($value)) {
1450 1450
             static::reportInvalidArgument(\sprintf(
1451 1451
                 $message ?: 'The path %s is not a file.',
1452 1452
                 static::valueToString($value)
@@ -1464,7 +1464,7 @@  discard block
 block discarded – undo
1464 1464
     {
1465 1465
         static::fileExists($value, $message);
1466 1466
 
1467
-        if (!\is_dir($value)) {
1467
+        if ( ! \is_dir($value)) {
1468 1468
             static::reportInvalidArgument(\sprintf(
1469 1469
                 $message ?: 'The path %s is no directory.',
1470 1470
                 static::valueToString($value)
@@ -1480,7 +1480,7 @@  discard block
 block discarded – undo
1480 1480
      */
1481 1481
     public static function readable($value, $message = '')
1482 1482
     {
1483
-        if (!\is_readable($value)) {
1483
+        if ( ! \is_readable($value)) {
1484 1484
             static::reportInvalidArgument(\sprintf(
1485 1485
                 $message ?: 'The path %s is not readable.',
1486 1486
                 static::valueToString($value)
@@ -1496,7 +1496,7 @@  discard block
 block discarded – undo
1496 1496
      */
1497 1497
     public static function writable($value, $message = '')
1498 1498
     {
1499
-        if (!\is_writable($value)) {
1499
+        if ( ! \is_writable($value)) {
1500 1500
             static::reportInvalidArgument(\sprintf(
1501 1501
                 $message ?: 'The path %s is not writable.',
1502 1502
                 static::valueToString($value)
@@ -1514,7 +1514,7 @@  discard block
 block discarded – undo
1514 1514
      */
1515 1515
     public static function classExists($value, $message = '')
1516 1516
     {
1517
-        if (!\class_exists($value)) {
1517
+        if ( ! \class_exists($value)) {
1518 1518
             static::reportInvalidArgument(\sprintf(
1519 1519
                 $message ?: 'Expected an existing class name. Got: %s',
1520 1520
                 static::valueToString($value)
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
      */
1537 1537
     public static function subclassOf($value, $class, $message = '')
1538 1538
     {
1539
-        if (!\is_subclass_of($value, $class)) {
1539
+        if ( ! \is_subclass_of($value, $class)) {
1540 1540
             static::reportInvalidArgument(\sprintf(
1541 1541
                 $message ?: 'Expected a sub-class of %2$s. Got: %s',
1542 1542
                 static::valueToString($value),
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
      */
1556 1556
     public static function interfaceExists($value, $message = '')
1557 1557
     {
1558
-        if (!\interface_exists($value)) {
1558
+        if ( ! \interface_exists($value)) {
1559 1559
             static::reportInvalidArgument(\sprintf(
1560 1560
                 $message ?: 'Expected an existing interface name. got %s',
1561 1561
                 static::valueToString($value)
@@ -1577,7 +1577,7 @@  discard block
 block discarded – undo
1577 1577
      */
1578 1578
     public static function implementsInterface($value, $interface, $message = '')
1579 1579
     {
1580
-        if (!\in_array($interface, \class_implements($value))) {
1580
+        if ( ! \in_array($interface, \class_implements($value))) {
1581 1581
             static::reportInvalidArgument(\sprintf(
1582 1582
                 $message ?: 'Expected an implementation of %2$s. Got: %s',
1583 1583
                 static::valueToString($value),
@@ -1598,7 +1598,7 @@  discard block
 block discarded – undo
1598 1598
      */
1599 1599
     public static function propertyExists($classOrObject, $property, $message = '')
1600 1600
     {
1601
-        if (!\property_exists($classOrObject, $property)) {
1601
+        if ( ! \property_exists($classOrObject, $property)) {
1602 1602
             static::reportInvalidArgument(\sprintf(
1603 1603
                 $message ?: 'Expected the property %s to exist.',
1604 1604
                 static::valueToString($property)
@@ -1638,7 +1638,7 @@  discard block
 block discarded – undo
1638 1638
      */
1639 1639
     public static function methodExists($classOrObject, $method, $message = '')
1640 1640
     {
1641
-        if (!(\is_string($classOrObject) || \is_object($classOrObject)) || !\method_exists($classOrObject, $method)) {
1641
+        if ( ! (\is_string($classOrObject) || \is_object($classOrObject)) || ! \method_exists($classOrObject, $method)) {
1642 1642
             static::reportInvalidArgument(\sprintf(
1643 1643
                 $message ?: 'Expected the method %s to exist.',
1644 1644
                 static::valueToString($method)
@@ -1677,7 +1677,7 @@  discard block
 block discarded – undo
1677 1677
      */
1678 1678
     public static function keyExists($array, $key, $message = '')
1679 1679
     {
1680
-        if (!(isset($array[$key]) || \array_key_exists($key, $array))) {
1680
+        if ( ! (isset($array[$key]) || \array_key_exists($key, $array))) {
1681 1681
             static::reportInvalidArgument(\sprintf(
1682 1682
                 $message ?: 'Expected the key %s to exist.',
1683 1683
                 static::valueToString($key)
@@ -1717,7 +1717,7 @@  discard block
 block discarded – undo
1717 1717
      */
1718 1718
     public static function validArrayKey($value, $message = '')
1719 1719
     {
1720
-        if (!(\is_int($value) || \is_string($value))) {
1720
+        if ( ! (\is_int($value) || \is_string($value))) {
1721 1721
             static::reportInvalidArgument(\sprintf(
1722 1722
                 $message ?: 'Expected string or integer. Got: %s',
1723 1723
                 static::typeToString($value)
@@ -1822,7 +1822,7 @@  discard block
 block discarded – undo
1822 1822
      */
1823 1823
     public static function isList($array, $message = '')
1824 1824
     {
1825
-        if (!\is_array($array) || $array !== \array_values($array)) {
1825
+        if ( ! \is_array($array) || $array !== \array_values($array)) {
1826 1826
             static::reportInvalidArgument(
1827 1827
                 $message ?: 'Expected list - non-associative array.'
1828 1828
             );
@@ -1858,7 +1858,7 @@  discard block
 block discarded – undo
1858 1858
     public static function isMap($array, $message = '')
1859 1859
     {
1860 1860
         if (
1861
-            !\is_array($array) ||
1861
+            ! \is_array($array) ||
1862 1862
             \array_keys($array) !== \array_filter(\array_keys($array), '\is_string')
1863 1863
         ) {
1864 1864
             static::reportInvalidArgument(
@@ -1903,7 +1903,7 @@  discard block
 block discarded – undo
1903 1903
             return;
1904 1904
         }
1905 1905
 
1906
-        if (!\preg_match('/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/', $value)) {
1906
+        if ( ! \preg_match('/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/', $value)) {
1907 1907
             static::reportInvalidArgument(\sprintf(
1908 1908
                 $message ?: 'Value %s is not a valid UUID.',
1909 1909
                 static::valueToString($value)
@@ -2037,7 +2037,7 @@  discard block
 block discarded – undo
2037 2037
 
2038 2038
     protected static function strlen($value)
2039 2039
     {
2040
-        if (!\function_exists('mb_detect_encoding')) {
2040
+        if ( ! \function_exists('mb_detect_encoding')) {
2041 2041
             return \strlen($value);
2042 2042
         }
2043 2043
 
Please login to merge, or discard this patch.
vendor/webmozart/assert/src/Mixin.php 1 patch
Indentation   +2896 added lines, -2896 removed lines patch added patch discarded remove patch
@@ -17,2900 +17,2900 @@
 block discarded – undo
17 17
  */
18 18
 trait Mixin
19 19
 {
20
-    /**
21
-     * @psalm-pure
22
-     * @psalm-assert string|null $value
23
-     *
24
-     * @param mixed  $value
25
-     * @param string $message
26
-     *
27
-     * @throws InvalidArgumentException
28
-     *
29
-     * @return void
30
-     */
31
-    public static function nullOrString($value, $message = '')
32
-    {
33
-        static::__callStatic('nullOrString', array($value, $message));
34
-    }
35
-
36
-    /**
37
-     * @psalm-pure
38
-     * @psalm-assert iterable<string> $value
39
-     *
40
-     * @param mixed  $value
41
-     * @param string $message
42
-     *
43
-     * @throws InvalidArgumentException
44
-     *
45
-     * @return void
46
-     */
47
-    public static function allString($value, $message = '')
48
-    {
49
-        static::__callStatic('allString', array($value, $message));
50
-    }
51
-
52
-    /**
53
-     * @psalm-pure
54
-     * @psalm-assert non-empty-string|null $value
55
-     *
56
-     * @param mixed  $value
57
-     * @param string $message
58
-     *
59
-     * @throws InvalidArgumentException
60
-     *
61
-     * @return void
62
-     */
63
-    public static function nullOrStringNotEmpty($value, $message = '')
64
-    {
65
-        static::__callStatic('nullOrStringNotEmpty', array($value, $message));
66
-    }
67
-
68
-    /**
69
-     * @psalm-pure
70
-     * @psalm-assert iterable<non-empty-string> $value
71
-     *
72
-     * @param mixed  $value
73
-     * @param string $message
74
-     *
75
-     * @throws InvalidArgumentException
76
-     *
77
-     * @return void
78
-     */
79
-    public static function allStringNotEmpty($value, $message = '')
80
-    {
81
-        static::__callStatic('allStringNotEmpty', array($value, $message));
82
-    }
83
-
84
-    /**
85
-     * @psalm-pure
86
-     * @psalm-assert int|null $value
87
-     *
88
-     * @param mixed  $value
89
-     * @param string $message
90
-     *
91
-     * @throws InvalidArgumentException
92
-     *
93
-     * @return void
94
-     */
95
-    public static function nullOrInteger($value, $message = '')
96
-    {
97
-        static::__callStatic('nullOrInteger', array($value, $message));
98
-    }
99
-
100
-    /**
101
-     * @psalm-pure
102
-     * @psalm-assert iterable<int> $value
103
-     *
104
-     * @param mixed  $value
105
-     * @param string $message
106
-     *
107
-     * @throws InvalidArgumentException
108
-     *
109
-     * @return void
110
-     */
111
-    public static function allInteger($value, $message = '')
112
-    {
113
-        static::__callStatic('allInteger', array($value, $message));
114
-    }
115
-
116
-    /**
117
-     * @psalm-pure
118
-     * @psalm-assert numeric|null $value
119
-     *
120
-     * @param mixed  $value
121
-     * @param string $message
122
-     *
123
-     * @throws InvalidArgumentException
124
-     *
125
-     * @return void
126
-     */
127
-    public static function nullOrIntegerish($value, $message = '')
128
-    {
129
-        static::__callStatic('nullOrIntegerish', array($value, $message));
130
-    }
131
-
132
-    /**
133
-     * @psalm-pure
134
-     * @psalm-assert iterable<numeric> $value
135
-     *
136
-     * @param mixed  $value
137
-     * @param string $message
138
-     *
139
-     * @throws InvalidArgumentException
140
-     *
141
-     * @return void
142
-     */
143
-    public static function allIntegerish($value, $message = '')
144
-    {
145
-        static::__callStatic('allIntegerish', array($value, $message));
146
-    }
147
-
148
-    /**
149
-     * @psalm-pure
150
-     * @psalm-assert positive-int|null $value
151
-     *
152
-     * @param mixed  $value
153
-     * @param string $message
154
-     *
155
-     * @throws InvalidArgumentException
156
-     *
157
-     * @return void
158
-     */
159
-    public static function nullOrPositiveInteger($value, $message = '')
160
-    {
161
-        static::__callStatic('nullOrPositiveInteger', array($value, $message));
162
-    }
163
-
164
-    /**
165
-     * @psalm-pure
166
-     * @psalm-assert iterable<positive-int> $value
167
-     *
168
-     * @param mixed  $value
169
-     * @param string $message
170
-     *
171
-     * @throws InvalidArgumentException
172
-     *
173
-     * @return void
174
-     */
175
-    public static function allPositiveInteger($value, $message = '')
176
-    {
177
-        static::__callStatic('allPositiveInteger', array($value, $message));
178
-    }
179
-
180
-    /**
181
-     * @psalm-pure
182
-     * @psalm-assert float|null $value
183
-     *
184
-     * @param mixed  $value
185
-     * @param string $message
186
-     *
187
-     * @throws InvalidArgumentException
188
-     *
189
-     * @return void
190
-     */
191
-    public static function nullOrFloat($value, $message = '')
192
-    {
193
-        static::__callStatic('nullOrFloat', array($value, $message));
194
-    }
195
-
196
-    /**
197
-     * @psalm-pure
198
-     * @psalm-assert iterable<float> $value
199
-     *
200
-     * @param mixed  $value
201
-     * @param string $message
202
-     *
203
-     * @throws InvalidArgumentException
204
-     *
205
-     * @return void
206
-     */
207
-    public static function allFloat($value, $message = '')
208
-    {
209
-        static::__callStatic('allFloat', array($value, $message));
210
-    }
211
-
212
-    /**
213
-     * @psalm-pure
214
-     * @psalm-assert numeric|null $value
215
-     *
216
-     * @param mixed  $value
217
-     * @param string $message
218
-     *
219
-     * @throws InvalidArgumentException
220
-     *
221
-     * @return void
222
-     */
223
-    public static function nullOrNumeric($value, $message = '')
224
-    {
225
-        static::__callStatic('nullOrNumeric', array($value, $message));
226
-    }
227
-
228
-    /**
229
-     * @psalm-pure
230
-     * @psalm-assert iterable<numeric> $value
231
-     *
232
-     * @param mixed  $value
233
-     * @param string $message
234
-     *
235
-     * @throws InvalidArgumentException
236
-     *
237
-     * @return void
238
-     */
239
-    public static function allNumeric($value, $message = '')
240
-    {
241
-        static::__callStatic('allNumeric', array($value, $message));
242
-    }
243
-
244
-    /**
245
-     * @psalm-pure
246
-     * @psalm-assert positive-int|0|null $value
247
-     *
248
-     * @param mixed  $value
249
-     * @param string $message
250
-     *
251
-     * @throws InvalidArgumentException
252
-     *
253
-     * @return void
254
-     */
255
-    public static function nullOrNatural($value, $message = '')
256
-    {
257
-        static::__callStatic('nullOrNatural', array($value, $message));
258
-    }
259
-
260
-    /**
261
-     * @psalm-pure
262
-     * @psalm-assert iterable<positive-int|0> $value
263
-     *
264
-     * @param mixed  $value
265
-     * @param string $message
266
-     *
267
-     * @throws InvalidArgumentException
268
-     *
269
-     * @return void
270
-     */
271
-    public static function allNatural($value, $message = '')
272
-    {
273
-        static::__callStatic('allNatural', array($value, $message));
274
-    }
275
-
276
-    /**
277
-     * @psalm-pure
278
-     * @psalm-assert bool|null $value
279
-     *
280
-     * @param mixed  $value
281
-     * @param string $message
282
-     *
283
-     * @throws InvalidArgumentException
284
-     *
285
-     * @return void
286
-     */
287
-    public static function nullOrBoolean($value, $message = '')
288
-    {
289
-        static::__callStatic('nullOrBoolean', array($value, $message));
290
-    }
291
-
292
-    /**
293
-     * @psalm-pure
294
-     * @psalm-assert iterable<bool> $value
295
-     *
296
-     * @param mixed  $value
297
-     * @param string $message
298
-     *
299
-     * @throws InvalidArgumentException
300
-     *
301
-     * @return void
302
-     */
303
-    public static function allBoolean($value, $message = '')
304
-    {
305
-        static::__callStatic('allBoolean', array($value, $message));
306
-    }
307
-
308
-    /**
309
-     * @psalm-pure
310
-     * @psalm-assert scalar|null $value
311
-     *
312
-     * @param mixed  $value
313
-     * @param string $message
314
-     *
315
-     * @throws InvalidArgumentException
316
-     *
317
-     * @return void
318
-     */
319
-    public static function nullOrScalar($value, $message = '')
320
-    {
321
-        static::__callStatic('nullOrScalar', array($value, $message));
322
-    }
323
-
324
-    /**
325
-     * @psalm-pure
326
-     * @psalm-assert iterable<scalar> $value
327
-     *
328
-     * @param mixed  $value
329
-     * @param string $message
330
-     *
331
-     * @throws InvalidArgumentException
332
-     *
333
-     * @return void
334
-     */
335
-    public static function allScalar($value, $message = '')
336
-    {
337
-        static::__callStatic('allScalar', array($value, $message));
338
-    }
339
-
340
-    /**
341
-     * @psalm-pure
342
-     * @psalm-assert object|null $value
343
-     *
344
-     * @param mixed  $value
345
-     * @param string $message
346
-     *
347
-     * @throws InvalidArgumentException
348
-     *
349
-     * @return void
350
-     */
351
-    public static function nullOrObject($value, $message = '')
352
-    {
353
-        static::__callStatic('nullOrObject', array($value, $message));
354
-    }
355
-
356
-    /**
357
-     * @psalm-pure
358
-     * @psalm-assert iterable<object> $value
359
-     *
360
-     * @param mixed  $value
361
-     * @param string $message
362
-     *
363
-     * @throws InvalidArgumentException
364
-     *
365
-     * @return void
366
-     */
367
-    public static function allObject($value, $message = '')
368
-    {
369
-        static::__callStatic('allObject', array($value, $message));
370
-    }
371
-
372
-    /**
373
-     * @psalm-pure
374
-     * @psalm-assert resource|null $value
375
-     *
376
-     * @param mixed       $value
377
-     * @param string|null $type    type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php
378
-     * @param string      $message
379
-     *
380
-     * @throws InvalidArgumentException
381
-     *
382
-     * @return void
383
-     */
384
-    public static function nullOrResource($value, $type = null, $message = '')
385
-    {
386
-        static::__callStatic('nullOrResource', array($value, $type, $message));
387
-    }
388
-
389
-    /**
390
-     * @psalm-pure
391
-     * @psalm-assert iterable<resource> $value
392
-     *
393
-     * @param mixed       $value
394
-     * @param string|null $type    type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php
395
-     * @param string      $message
396
-     *
397
-     * @throws InvalidArgumentException
398
-     *
399
-     * @return void
400
-     */
401
-    public static function allResource($value, $type = null, $message = '')
402
-    {
403
-        static::__callStatic('allResource', array($value, $type, $message));
404
-    }
405
-
406
-    /**
407
-     * @psalm-pure
408
-     * @psalm-assert callable|null $value
409
-     *
410
-     * @param mixed  $value
411
-     * @param string $message
412
-     *
413
-     * @throws InvalidArgumentException
414
-     *
415
-     * @return void
416
-     */
417
-    public static function nullOrIsCallable($value, $message = '')
418
-    {
419
-        static::__callStatic('nullOrIsCallable', array($value, $message));
420
-    }
421
-
422
-    /**
423
-     * @psalm-pure
424
-     * @psalm-assert iterable<callable> $value
425
-     *
426
-     * @param mixed  $value
427
-     * @param string $message
428
-     *
429
-     * @throws InvalidArgumentException
430
-     *
431
-     * @return void
432
-     */
433
-    public static function allIsCallable($value, $message = '')
434
-    {
435
-        static::__callStatic('allIsCallable', array($value, $message));
436
-    }
437
-
438
-    /**
439
-     * @psalm-pure
440
-     * @psalm-assert array|null $value
441
-     *
442
-     * @param mixed  $value
443
-     * @param string $message
444
-     *
445
-     * @throws InvalidArgumentException
446
-     *
447
-     * @return void
448
-     */
449
-    public static function nullOrIsArray($value, $message = '')
450
-    {
451
-        static::__callStatic('nullOrIsArray', array($value, $message));
452
-    }
453
-
454
-    /**
455
-     * @psalm-pure
456
-     * @psalm-assert iterable<array> $value
457
-     *
458
-     * @param mixed  $value
459
-     * @param string $message
460
-     *
461
-     * @throws InvalidArgumentException
462
-     *
463
-     * @return void
464
-     */
465
-    public static function allIsArray($value, $message = '')
466
-    {
467
-        static::__callStatic('allIsArray', array($value, $message));
468
-    }
469
-
470
-    /**
471
-     * @psalm-pure
472
-     * @psalm-assert iterable|null $value
473
-     *
474
-     * @deprecated use "isIterable" or "isInstanceOf" instead
475
-     *
476
-     * @param mixed  $value
477
-     * @param string $message
478
-     *
479
-     * @throws InvalidArgumentException
480
-     *
481
-     * @return void
482
-     */
483
-    public static function nullOrIsTraversable($value, $message = '')
484
-    {
485
-        static::__callStatic('nullOrIsTraversable', array($value, $message));
486
-    }
487
-
488
-    /**
489
-     * @psalm-pure
490
-     * @psalm-assert iterable<iterable> $value
491
-     *
492
-     * @deprecated use "isIterable" or "isInstanceOf" instead
493
-     *
494
-     * @param mixed  $value
495
-     * @param string $message
496
-     *
497
-     * @throws InvalidArgumentException
498
-     *
499
-     * @return void
500
-     */
501
-    public static function allIsTraversable($value, $message = '')
502
-    {
503
-        static::__callStatic('allIsTraversable', array($value, $message));
504
-    }
505
-
506
-    /**
507
-     * @psalm-pure
508
-     * @psalm-assert array|ArrayAccess|null $value
509
-     *
510
-     * @param mixed  $value
511
-     * @param string $message
512
-     *
513
-     * @throws InvalidArgumentException
514
-     *
515
-     * @return void
516
-     */
517
-    public static function nullOrIsArrayAccessible($value, $message = '')
518
-    {
519
-        static::__callStatic('nullOrIsArrayAccessible', array($value, $message));
520
-    }
521
-
522
-    /**
523
-     * @psalm-pure
524
-     * @psalm-assert iterable<array|ArrayAccess> $value
525
-     *
526
-     * @param mixed  $value
527
-     * @param string $message
528
-     *
529
-     * @throws InvalidArgumentException
530
-     *
531
-     * @return void
532
-     */
533
-    public static function allIsArrayAccessible($value, $message = '')
534
-    {
535
-        static::__callStatic('allIsArrayAccessible', array($value, $message));
536
-    }
537
-
538
-    /**
539
-     * @psalm-pure
540
-     * @psalm-assert countable|null $value
541
-     *
542
-     * @param mixed  $value
543
-     * @param string $message
544
-     *
545
-     * @throws InvalidArgumentException
546
-     *
547
-     * @return void
548
-     */
549
-    public static function nullOrIsCountable($value, $message = '')
550
-    {
551
-        static::__callStatic('nullOrIsCountable', array($value, $message));
552
-    }
553
-
554
-    /**
555
-     * @psalm-pure
556
-     * @psalm-assert iterable<countable> $value
557
-     *
558
-     * @param mixed  $value
559
-     * @param string $message
560
-     *
561
-     * @throws InvalidArgumentException
562
-     *
563
-     * @return void
564
-     */
565
-    public static function allIsCountable($value, $message = '')
566
-    {
567
-        static::__callStatic('allIsCountable', array($value, $message));
568
-    }
569
-
570
-    /**
571
-     * @psalm-pure
572
-     * @psalm-assert iterable|null $value
573
-     *
574
-     * @param mixed  $value
575
-     * @param string $message
576
-     *
577
-     * @throws InvalidArgumentException
578
-     *
579
-     * @return void
580
-     */
581
-    public static function nullOrIsIterable($value, $message = '')
582
-    {
583
-        static::__callStatic('nullOrIsIterable', array($value, $message));
584
-    }
585
-
586
-    /**
587
-     * @psalm-pure
588
-     * @psalm-assert iterable<iterable> $value
589
-     *
590
-     * @param mixed  $value
591
-     * @param string $message
592
-     *
593
-     * @throws InvalidArgumentException
594
-     *
595
-     * @return void
596
-     */
597
-    public static function allIsIterable($value, $message = '')
598
-    {
599
-        static::__callStatic('allIsIterable', array($value, $message));
600
-    }
601
-
602
-    /**
603
-     * @psalm-pure
604
-     * @psalm-template ExpectedType of object
605
-     * @psalm-param class-string<ExpectedType> $class
606
-     * @psalm-assert ExpectedType|null $value
607
-     *
608
-     * @param mixed         $value
609
-     * @param string|object $class
610
-     * @param string        $message
611
-     *
612
-     * @throws InvalidArgumentException
613
-     *
614
-     * @return void
615
-     */
616
-    public static function nullOrIsInstanceOf($value, $class, $message = '')
617
-    {
618
-        static::__callStatic('nullOrIsInstanceOf', array($value, $class, $message));
619
-    }
620
-
621
-    /**
622
-     * @psalm-pure
623
-     * @psalm-template ExpectedType of object
624
-     * @psalm-param class-string<ExpectedType> $class
625
-     * @psalm-assert iterable<ExpectedType> $value
626
-     *
627
-     * @param mixed         $value
628
-     * @param string|object $class
629
-     * @param string        $message
630
-     *
631
-     * @throws InvalidArgumentException
632
-     *
633
-     * @return void
634
-     */
635
-    public static function allIsInstanceOf($value, $class, $message = '')
636
-    {
637
-        static::__callStatic('allIsInstanceOf', array($value, $class, $message));
638
-    }
639
-
640
-    /**
641
-     * @psalm-pure
642
-     * @psalm-template ExpectedType of object
643
-     * @psalm-param class-string<ExpectedType> $class
644
-     *
645
-     * @param mixed         $value
646
-     * @param string|object $class
647
-     * @param string        $message
648
-     *
649
-     * @throws InvalidArgumentException
650
-     *
651
-     * @return void
652
-     */
653
-    public static function nullOrNotInstanceOf($value, $class, $message = '')
654
-    {
655
-        static::__callStatic('nullOrNotInstanceOf', array($value, $class, $message));
656
-    }
657
-
658
-    /**
659
-     * @psalm-pure
660
-     * @psalm-template ExpectedType of object
661
-     * @psalm-param class-string<ExpectedType> $class
662
-     *
663
-     * @param mixed         $value
664
-     * @param string|object $class
665
-     * @param string        $message
666
-     *
667
-     * @throws InvalidArgumentException
668
-     *
669
-     * @return void
670
-     */
671
-    public static function allNotInstanceOf($value, $class, $message = '')
672
-    {
673
-        static::__callStatic('allNotInstanceOf', array($value, $class, $message));
674
-    }
675
-
676
-    /**
677
-     * @psalm-pure
678
-     * @psalm-param array<class-string> $classes
679
-     *
680
-     * @param mixed                $value
681
-     * @param array<object|string> $classes
682
-     * @param string               $message
683
-     *
684
-     * @throws InvalidArgumentException
685
-     *
686
-     * @return void
687
-     */
688
-    public static function nullOrIsInstanceOfAny($value, $classes, $message = '')
689
-    {
690
-        static::__callStatic('nullOrIsInstanceOfAny', array($value, $classes, $message));
691
-    }
692
-
693
-    /**
694
-     * @psalm-pure
695
-     * @psalm-param array<class-string> $classes
696
-     *
697
-     * @param mixed                $value
698
-     * @param array<object|string> $classes
699
-     * @param string               $message
700
-     *
701
-     * @throws InvalidArgumentException
702
-     *
703
-     * @return void
704
-     */
705
-    public static function allIsInstanceOfAny($value, $classes, $message = '')
706
-    {
707
-        static::__callStatic('allIsInstanceOfAny', array($value, $classes, $message));
708
-    }
709
-
710
-    /**
711
-     * @psalm-pure
712
-     * @psalm-template ExpectedType of object
713
-     * @psalm-param class-string<ExpectedType> $class
714
-     * @psalm-assert ExpectedType|class-string<ExpectedType>|null $value
715
-     *
716
-     * @param object|string|null $value
717
-     * @param string             $class
718
-     * @param string             $message
719
-     *
720
-     * @throws InvalidArgumentException
721
-     *
722
-     * @return void
723
-     */
724
-    public static function nullOrIsAOf($value, $class, $message = '')
725
-    {
726
-        static::__callStatic('nullOrIsAOf', array($value, $class, $message));
727
-    }
728
-
729
-    /**
730
-     * @psalm-pure
731
-     * @psalm-template ExpectedType of object
732
-     * @psalm-param class-string<ExpectedType> $class
733
-     * @psalm-assert iterable<ExpectedType|class-string<ExpectedType>> $value
734
-     *
735
-     * @param iterable<object|string> $value
736
-     * @param string                  $class
737
-     * @param string                  $message
738
-     *
739
-     * @throws InvalidArgumentException
740
-     *
741
-     * @return void
742
-     */
743
-    public static function allIsAOf($value, $class, $message = '')
744
-    {
745
-        static::__callStatic('allIsAOf', array($value, $class, $message));
746
-    }
747
-
748
-    /**
749
-     * @psalm-pure
750
-     * @psalm-template UnexpectedType of object
751
-     * @psalm-param class-string<UnexpectedType> $class
752
-     *
753
-     * @param object|string|null $value
754
-     * @param string             $class
755
-     * @param string             $message
756
-     *
757
-     * @throws InvalidArgumentException
758
-     *
759
-     * @return void
760
-     */
761
-    public static function nullOrIsNotA($value, $class, $message = '')
762
-    {
763
-        static::__callStatic('nullOrIsNotA', array($value, $class, $message));
764
-    }
765
-
766
-    /**
767
-     * @psalm-pure
768
-     * @psalm-template UnexpectedType of object
769
-     * @psalm-param class-string<UnexpectedType> $class
770
-     *
771
-     * @param iterable<object|string> $value
772
-     * @param string                  $class
773
-     * @param string                  $message
774
-     *
775
-     * @throws InvalidArgumentException
776
-     *
777
-     * @return void
778
-     */
779
-    public static function allIsNotA($value, $class, $message = '')
780
-    {
781
-        static::__callStatic('allIsNotA', array($value, $class, $message));
782
-    }
783
-
784
-    /**
785
-     * @psalm-pure
786
-     * @psalm-param array<class-string> $classes
787
-     *
788
-     * @param object|string|null $value
789
-     * @param string[]           $classes
790
-     * @param string             $message
791
-     *
792
-     * @throws InvalidArgumentException
793
-     *
794
-     * @return void
795
-     */
796
-    public static function nullOrIsAnyOf($value, $classes, $message = '')
797
-    {
798
-        static::__callStatic('nullOrIsAnyOf', array($value, $classes, $message));
799
-    }
800
-
801
-    /**
802
-     * @psalm-pure
803
-     * @psalm-param array<class-string> $classes
804
-     *
805
-     * @param iterable<object|string> $value
806
-     * @param string[]                $classes
807
-     * @param string                  $message
808
-     *
809
-     * @throws InvalidArgumentException
810
-     *
811
-     * @return void
812
-     */
813
-    public static function allIsAnyOf($value, $classes, $message = '')
814
-    {
815
-        static::__callStatic('allIsAnyOf', array($value, $classes, $message));
816
-    }
817
-
818
-    /**
819
-     * @psalm-pure
820
-     * @psalm-assert empty $value
821
-     *
822
-     * @param mixed  $value
823
-     * @param string $message
824
-     *
825
-     * @throws InvalidArgumentException
826
-     *
827
-     * @return void
828
-     */
829
-    public static function nullOrIsEmpty($value, $message = '')
830
-    {
831
-        static::__callStatic('nullOrIsEmpty', array($value, $message));
832
-    }
833
-
834
-    /**
835
-     * @psalm-pure
836
-     * @psalm-assert iterable<empty> $value
837
-     *
838
-     * @param mixed  $value
839
-     * @param string $message
840
-     *
841
-     * @throws InvalidArgumentException
842
-     *
843
-     * @return void
844
-     */
845
-    public static function allIsEmpty($value, $message = '')
846
-    {
847
-        static::__callStatic('allIsEmpty', array($value, $message));
848
-    }
849
-
850
-    /**
851
-     * @psalm-pure
852
-     *
853
-     * @param mixed  $value
854
-     * @param string $message
855
-     *
856
-     * @throws InvalidArgumentException
857
-     *
858
-     * @return void
859
-     */
860
-    public static function nullOrNotEmpty($value, $message = '')
861
-    {
862
-        static::__callStatic('nullOrNotEmpty', array($value, $message));
863
-    }
864
-
865
-    /**
866
-     * @psalm-pure
867
-     *
868
-     * @param mixed  $value
869
-     * @param string $message
870
-     *
871
-     * @throws InvalidArgumentException
872
-     *
873
-     * @return void
874
-     */
875
-    public static function allNotEmpty($value, $message = '')
876
-    {
877
-        static::__callStatic('allNotEmpty', array($value, $message));
878
-    }
879
-
880
-    /**
881
-     * @psalm-pure
882
-     * @psalm-assert iterable<null> $value
883
-     *
884
-     * @param mixed  $value
885
-     * @param string $message
886
-     *
887
-     * @throws InvalidArgumentException
888
-     *
889
-     * @return void
890
-     */
891
-    public static function allNull($value, $message = '')
892
-    {
893
-        static::__callStatic('allNull', array($value, $message));
894
-    }
895
-
896
-    /**
897
-     * @psalm-pure
898
-     *
899
-     * @param mixed  $value
900
-     * @param string $message
901
-     *
902
-     * @throws InvalidArgumentException
903
-     *
904
-     * @return void
905
-     */
906
-    public static function allNotNull($value, $message = '')
907
-    {
908
-        static::__callStatic('allNotNull', array($value, $message));
909
-    }
910
-
911
-    /**
912
-     * @psalm-pure
913
-     * @psalm-assert true|null $value
914
-     *
915
-     * @param mixed  $value
916
-     * @param string $message
917
-     *
918
-     * @throws InvalidArgumentException
919
-     *
920
-     * @return void
921
-     */
922
-    public static function nullOrTrue($value, $message = '')
923
-    {
924
-        static::__callStatic('nullOrTrue', array($value, $message));
925
-    }
926
-
927
-    /**
928
-     * @psalm-pure
929
-     * @psalm-assert iterable<true> $value
930
-     *
931
-     * @param mixed  $value
932
-     * @param string $message
933
-     *
934
-     * @throws InvalidArgumentException
935
-     *
936
-     * @return void
937
-     */
938
-    public static function allTrue($value, $message = '')
939
-    {
940
-        static::__callStatic('allTrue', array($value, $message));
941
-    }
942
-
943
-    /**
944
-     * @psalm-pure
945
-     * @psalm-assert false|null $value
946
-     *
947
-     * @param mixed  $value
948
-     * @param string $message
949
-     *
950
-     * @throws InvalidArgumentException
951
-     *
952
-     * @return void
953
-     */
954
-    public static function nullOrFalse($value, $message = '')
955
-    {
956
-        static::__callStatic('nullOrFalse', array($value, $message));
957
-    }
958
-
959
-    /**
960
-     * @psalm-pure
961
-     * @psalm-assert iterable<false> $value
962
-     *
963
-     * @param mixed  $value
964
-     * @param string $message
965
-     *
966
-     * @throws InvalidArgumentException
967
-     *
968
-     * @return void
969
-     */
970
-    public static function allFalse($value, $message = '')
971
-    {
972
-        static::__callStatic('allFalse', array($value, $message));
973
-    }
974
-
975
-    /**
976
-     * @psalm-pure
977
-     *
978
-     * @param mixed  $value
979
-     * @param string $message
980
-     *
981
-     * @throws InvalidArgumentException
982
-     *
983
-     * @return void
984
-     */
985
-    public static function nullOrNotFalse($value, $message = '')
986
-    {
987
-        static::__callStatic('nullOrNotFalse', array($value, $message));
988
-    }
989
-
990
-    /**
991
-     * @psalm-pure
992
-     *
993
-     * @param mixed  $value
994
-     * @param string $message
995
-     *
996
-     * @throws InvalidArgumentException
997
-     *
998
-     * @return void
999
-     */
1000
-    public static function allNotFalse($value, $message = '')
1001
-    {
1002
-        static::__callStatic('allNotFalse', array($value, $message));
1003
-    }
1004
-
1005
-    /**
1006
-     * @param mixed  $value
1007
-     * @param string $message
1008
-     *
1009
-     * @throws InvalidArgumentException
1010
-     *
1011
-     * @return void
1012
-     */
1013
-    public static function nullOrIp($value, $message = '')
1014
-    {
1015
-        static::__callStatic('nullOrIp', array($value, $message));
1016
-    }
1017
-
1018
-    /**
1019
-     * @param mixed  $value
1020
-     * @param string $message
1021
-     *
1022
-     * @throws InvalidArgumentException
1023
-     *
1024
-     * @return void
1025
-     */
1026
-    public static function allIp($value, $message = '')
1027
-    {
1028
-        static::__callStatic('allIp', array($value, $message));
1029
-    }
1030
-
1031
-    /**
1032
-     * @param mixed  $value
1033
-     * @param string $message
1034
-     *
1035
-     * @throws InvalidArgumentException
1036
-     *
1037
-     * @return void
1038
-     */
1039
-    public static function nullOrIpv4($value, $message = '')
1040
-    {
1041
-        static::__callStatic('nullOrIpv4', array($value, $message));
1042
-    }
1043
-
1044
-    /**
1045
-     * @param mixed  $value
1046
-     * @param string $message
1047
-     *
1048
-     * @throws InvalidArgumentException
1049
-     *
1050
-     * @return void
1051
-     */
1052
-    public static function allIpv4($value, $message = '')
1053
-    {
1054
-        static::__callStatic('allIpv4', array($value, $message));
1055
-    }
1056
-
1057
-    /**
1058
-     * @param mixed  $value
1059
-     * @param string $message
1060
-     *
1061
-     * @throws InvalidArgumentException
1062
-     *
1063
-     * @return void
1064
-     */
1065
-    public static function nullOrIpv6($value, $message = '')
1066
-    {
1067
-        static::__callStatic('nullOrIpv6', array($value, $message));
1068
-    }
1069
-
1070
-    /**
1071
-     * @param mixed  $value
1072
-     * @param string $message
1073
-     *
1074
-     * @throws InvalidArgumentException
1075
-     *
1076
-     * @return void
1077
-     */
1078
-    public static function allIpv6($value, $message = '')
1079
-    {
1080
-        static::__callStatic('allIpv6', array($value, $message));
1081
-    }
1082
-
1083
-    /**
1084
-     * @param mixed  $value
1085
-     * @param string $message
1086
-     *
1087
-     * @throws InvalidArgumentException
1088
-     *
1089
-     * @return void
1090
-     */
1091
-    public static function nullOrEmail($value, $message = '')
1092
-    {
1093
-        static::__callStatic('nullOrEmail', array($value, $message));
1094
-    }
1095
-
1096
-    /**
1097
-     * @param mixed  $value
1098
-     * @param string $message
1099
-     *
1100
-     * @throws InvalidArgumentException
1101
-     *
1102
-     * @return void
1103
-     */
1104
-    public static function allEmail($value, $message = '')
1105
-    {
1106
-        static::__callStatic('allEmail', array($value, $message));
1107
-    }
1108
-
1109
-    /**
1110
-     * @param array|null $values
1111
-     * @param string     $message
1112
-     *
1113
-     * @throws InvalidArgumentException
1114
-     *
1115
-     * @return void
1116
-     */
1117
-    public static function nullOrUniqueValues($values, $message = '')
1118
-    {
1119
-        static::__callStatic('nullOrUniqueValues', array($values, $message));
1120
-    }
1121
-
1122
-    /**
1123
-     * @param iterable<array> $values
1124
-     * @param string          $message
1125
-     *
1126
-     * @throws InvalidArgumentException
1127
-     *
1128
-     * @return void
1129
-     */
1130
-    public static function allUniqueValues($values, $message = '')
1131
-    {
1132
-        static::__callStatic('allUniqueValues', array($values, $message));
1133
-    }
1134
-
1135
-    /**
1136
-     * @param mixed  $value
1137
-     * @param mixed  $expect
1138
-     * @param string $message
1139
-     *
1140
-     * @throws InvalidArgumentException
1141
-     *
1142
-     * @return void
1143
-     */
1144
-    public static function nullOrEq($value, $expect, $message = '')
1145
-    {
1146
-        static::__callStatic('nullOrEq', array($value, $expect, $message));
1147
-    }
1148
-
1149
-    /**
1150
-     * @param mixed  $value
1151
-     * @param mixed  $expect
1152
-     * @param string $message
1153
-     *
1154
-     * @throws InvalidArgumentException
1155
-     *
1156
-     * @return void
1157
-     */
1158
-    public static function allEq($value, $expect, $message = '')
1159
-    {
1160
-        static::__callStatic('allEq', array($value, $expect, $message));
1161
-    }
1162
-
1163
-    /**
1164
-     * @param mixed  $value
1165
-     * @param mixed  $expect
1166
-     * @param string $message
1167
-     *
1168
-     * @throws InvalidArgumentException
1169
-     *
1170
-     * @return void
1171
-     */
1172
-    public static function nullOrNotEq($value, $expect, $message = '')
1173
-    {
1174
-        static::__callStatic('nullOrNotEq', array($value, $expect, $message));
1175
-    }
1176
-
1177
-    /**
1178
-     * @param mixed  $value
1179
-     * @param mixed  $expect
1180
-     * @param string $message
1181
-     *
1182
-     * @throws InvalidArgumentException
1183
-     *
1184
-     * @return void
1185
-     */
1186
-    public static function allNotEq($value, $expect, $message = '')
1187
-    {
1188
-        static::__callStatic('allNotEq', array($value, $expect, $message));
1189
-    }
1190
-
1191
-    /**
1192
-     * @psalm-pure
1193
-     *
1194
-     * @param mixed  $value
1195
-     * @param mixed  $expect
1196
-     * @param string $message
1197
-     *
1198
-     * @throws InvalidArgumentException
1199
-     *
1200
-     * @return void
1201
-     */
1202
-    public static function nullOrSame($value, $expect, $message = '')
1203
-    {
1204
-        static::__callStatic('nullOrSame', array($value, $expect, $message));
1205
-    }
1206
-
1207
-    /**
1208
-     * @psalm-pure
1209
-     *
1210
-     * @param mixed  $value
1211
-     * @param mixed  $expect
1212
-     * @param string $message
1213
-     *
1214
-     * @throws InvalidArgumentException
1215
-     *
1216
-     * @return void
1217
-     */
1218
-    public static function allSame($value, $expect, $message = '')
1219
-    {
1220
-        static::__callStatic('allSame', array($value, $expect, $message));
1221
-    }
1222
-
1223
-    /**
1224
-     * @psalm-pure
1225
-     *
1226
-     * @param mixed  $value
1227
-     * @param mixed  $expect
1228
-     * @param string $message
1229
-     *
1230
-     * @throws InvalidArgumentException
1231
-     *
1232
-     * @return void
1233
-     */
1234
-    public static function nullOrNotSame($value, $expect, $message = '')
1235
-    {
1236
-        static::__callStatic('nullOrNotSame', array($value, $expect, $message));
1237
-    }
1238
-
1239
-    /**
1240
-     * @psalm-pure
1241
-     *
1242
-     * @param mixed  $value
1243
-     * @param mixed  $expect
1244
-     * @param string $message
1245
-     *
1246
-     * @throws InvalidArgumentException
1247
-     *
1248
-     * @return void
1249
-     */
1250
-    public static function allNotSame($value, $expect, $message = '')
1251
-    {
1252
-        static::__callStatic('allNotSame', array($value, $expect, $message));
1253
-    }
1254
-
1255
-    /**
1256
-     * @psalm-pure
1257
-     *
1258
-     * @param mixed  $value
1259
-     * @param mixed  $limit
1260
-     * @param string $message
1261
-     *
1262
-     * @throws InvalidArgumentException
1263
-     *
1264
-     * @return void
1265
-     */
1266
-    public static function nullOrGreaterThan($value, $limit, $message = '')
1267
-    {
1268
-        static::__callStatic('nullOrGreaterThan', array($value, $limit, $message));
1269
-    }
1270
-
1271
-    /**
1272
-     * @psalm-pure
1273
-     *
1274
-     * @param mixed  $value
1275
-     * @param mixed  $limit
1276
-     * @param string $message
1277
-     *
1278
-     * @throws InvalidArgumentException
1279
-     *
1280
-     * @return void
1281
-     */
1282
-    public static function allGreaterThan($value, $limit, $message = '')
1283
-    {
1284
-        static::__callStatic('allGreaterThan', array($value, $limit, $message));
1285
-    }
1286
-
1287
-    /**
1288
-     * @psalm-pure
1289
-     *
1290
-     * @param mixed  $value
1291
-     * @param mixed  $limit
1292
-     * @param string $message
1293
-     *
1294
-     * @throws InvalidArgumentException
1295
-     *
1296
-     * @return void
1297
-     */
1298
-    public static function nullOrGreaterThanEq($value, $limit, $message = '')
1299
-    {
1300
-        static::__callStatic('nullOrGreaterThanEq', array($value, $limit, $message));
1301
-    }
1302
-
1303
-    /**
1304
-     * @psalm-pure
1305
-     *
1306
-     * @param mixed  $value
1307
-     * @param mixed  $limit
1308
-     * @param string $message
1309
-     *
1310
-     * @throws InvalidArgumentException
1311
-     *
1312
-     * @return void
1313
-     */
1314
-    public static function allGreaterThanEq($value, $limit, $message = '')
1315
-    {
1316
-        static::__callStatic('allGreaterThanEq', array($value, $limit, $message));
1317
-    }
1318
-
1319
-    /**
1320
-     * @psalm-pure
1321
-     *
1322
-     * @param mixed  $value
1323
-     * @param mixed  $limit
1324
-     * @param string $message
1325
-     *
1326
-     * @throws InvalidArgumentException
1327
-     *
1328
-     * @return void
1329
-     */
1330
-    public static function nullOrLessThan($value, $limit, $message = '')
1331
-    {
1332
-        static::__callStatic('nullOrLessThan', array($value, $limit, $message));
1333
-    }
1334
-
1335
-    /**
1336
-     * @psalm-pure
1337
-     *
1338
-     * @param mixed  $value
1339
-     * @param mixed  $limit
1340
-     * @param string $message
1341
-     *
1342
-     * @throws InvalidArgumentException
1343
-     *
1344
-     * @return void
1345
-     */
1346
-    public static function allLessThan($value, $limit, $message = '')
1347
-    {
1348
-        static::__callStatic('allLessThan', array($value, $limit, $message));
1349
-    }
1350
-
1351
-    /**
1352
-     * @psalm-pure
1353
-     *
1354
-     * @param mixed  $value
1355
-     * @param mixed  $limit
1356
-     * @param string $message
1357
-     *
1358
-     * @throws InvalidArgumentException
1359
-     *
1360
-     * @return void
1361
-     */
1362
-    public static function nullOrLessThanEq($value, $limit, $message = '')
1363
-    {
1364
-        static::__callStatic('nullOrLessThanEq', array($value, $limit, $message));
1365
-    }
1366
-
1367
-    /**
1368
-     * @psalm-pure
1369
-     *
1370
-     * @param mixed  $value
1371
-     * @param mixed  $limit
1372
-     * @param string $message
1373
-     *
1374
-     * @throws InvalidArgumentException
1375
-     *
1376
-     * @return void
1377
-     */
1378
-    public static function allLessThanEq($value, $limit, $message = '')
1379
-    {
1380
-        static::__callStatic('allLessThanEq', array($value, $limit, $message));
1381
-    }
1382
-
1383
-    /**
1384
-     * @psalm-pure
1385
-     *
1386
-     * @param mixed  $value
1387
-     * @param mixed  $min
1388
-     * @param mixed  $max
1389
-     * @param string $message
1390
-     *
1391
-     * @throws InvalidArgumentException
1392
-     *
1393
-     * @return void
1394
-     */
1395
-    public static function nullOrRange($value, $min, $max, $message = '')
1396
-    {
1397
-        static::__callStatic('nullOrRange', array($value, $min, $max, $message));
1398
-    }
1399
-
1400
-    /**
1401
-     * @psalm-pure
1402
-     *
1403
-     * @param mixed  $value
1404
-     * @param mixed  $min
1405
-     * @param mixed  $max
1406
-     * @param string $message
1407
-     *
1408
-     * @throws InvalidArgumentException
1409
-     *
1410
-     * @return void
1411
-     */
1412
-    public static function allRange($value, $min, $max, $message = '')
1413
-    {
1414
-        static::__callStatic('allRange', array($value, $min, $max, $message));
1415
-    }
1416
-
1417
-    /**
1418
-     * @psalm-pure
1419
-     *
1420
-     * @param mixed  $value
1421
-     * @param array  $values
1422
-     * @param string $message
1423
-     *
1424
-     * @throws InvalidArgumentException
1425
-     *
1426
-     * @return void
1427
-     */
1428
-    public static function nullOrOneOf($value, $values, $message = '')
1429
-    {
1430
-        static::__callStatic('nullOrOneOf', array($value, $values, $message));
1431
-    }
1432
-
1433
-    /**
1434
-     * @psalm-pure
1435
-     *
1436
-     * @param mixed  $value
1437
-     * @param array  $values
1438
-     * @param string $message
1439
-     *
1440
-     * @throws InvalidArgumentException
1441
-     *
1442
-     * @return void
1443
-     */
1444
-    public static function allOneOf($value, $values, $message = '')
1445
-    {
1446
-        static::__callStatic('allOneOf', array($value, $values, $message));
1447
-    }
1448
-
1449
-    /**
1450
-     * @psalm-pure
1451
-     *
1452
-     * @param mixed  $value
1453
-     * @param array  $values
1454
-     * @param string $message
1455
-     *
1456
-     * @throws InvalidArgumentException
1457
-     *
1458
-     * @return void
1459
-     */
1460
-    public static function nullOrInArray($value, $values, $message = '')
1461
-    {
1462
-        static::__callStatic('nullOrInArray', array($value, $values, $message));
1463
-    }
1464
-
1465
-    /**
1466
-     * @psalm-pure
1467
-     *
1468
-     * @param mixed  $value
1469
-     * @param array  $values
1470
-     * @param string $message
1471
-     *
1472
-     * @throws InvalidArgumentException
1473
-     *
1474
-     * @return void
1475
-     */
1476
-    public static function allInArray($value, $values, $message = '')
1477
-    {
1478
-        static::__callStatic('allInArray', array($value, $values, $message));
1479
-    }
1480
-
1481
-    /**
1482
-     * @psalm-pure
1483
-     *
1484
-     * @param string|null $value
1485
-     * @param string      $subString
1486
-     * @param string      $message
1487
-     *
1488
-     * @throws InvalidArgumentException
1489
-     *
1490
-     * @return void
1491
-     */
1492
-    public static function nullOrContains($value, $subString, $message = '')
1493
-    {
1494
-        static::__callStatic('nullOrContains', array($value, $subString, $message));
1495
-    }
1496
-
1497
-    /**
1498
-     * @psalm-pure
1499
-     *
1500
-     * @param iterable<string> $value
1501
-     * @param string           $subString
1502
-     * @param string           $message
1503
-     *
1504
-     * @throws InvalidArgumentException
1505
-     *
1506
-     * @return void
1507
-     */
1508
-    public static function allContains($value, $subString, $message = '')
1509
-    {
1510
-        static::__callStatic('allContains', array($value, $subString, $message));
1511
-    }
1512
-
1513
-    /**
1514
-     * @psalm-pure
1515
-     *
1516
-     * @param string|null $value
1517
-     * @param string      $subString
1518
-     * @param string      $message
1519
-     *
1520
-     * @throws InvalidArgumentException
1521
-     *
1522
-     * @return void
1523
-     */
1524
-    public static function nullOrNotContains($value, $subString, $message = '')
1525
-    {
1526
-        static::__callStatic('nullOrNotContains', array($value, $subString, $message));
1527
-    }
1528
-
1529
-    /**
1530
-     * @psalm-pure
1531
-     *
1532
-     * @param iterable<string> $value
1533
-     * @param string           $subString
1534
-     * @param string           $message
1535
-     *
1536
-     * @throws InvalidArgumentException
1537
-     *
1538
-     * @return void
1539
-     */
1540
-    public static function allNotContains($value, $subString, $message = '')
1541
-    {
1542
-        static::__callStatic('allNotContains', array($value, $subString, $message));
1543
-    }
1544
-
1545
-    /**
1546
-     * @psalm-pure
1547
-     *
1548
-     * @param string|null $value
1549
-     * @param string      $message
1550
-     *
1551
-     * @throws InvalidArgumentException
1552
-     *
1553
-     * @return void
1554
-     */
1555
-    public static function nullOrNotWhitespaceOnly($value, $message = '')
1556
-    {
1557
-        static::__callStatic('nullOrNotWhitespaceOnly', array($value, $message));
1558
-    }
1559
-
1560
-    /**
1561
-     * @psalm-pure
1562
-     *
1563
-     * @param iterable<string> $value
1564
-     * @param string           $message
1565
-     *
1566
-     * @throws InvalidArgumentException
1567
-     *
1568
-     * @return void
1569
-     */
1570
-    public static function allNotWhitespaceOnly($value, $message = '')
1571
-    {
1572
-        static::__callStatic('allNotWhitespaceOnly', array($value, $message));
1573
-    }
1574
-
1575
-    /**
1576
-     * @psalm-pure
1577
-     *
1578
-     * @param string|null $value
1579
-     * @param string      $prefix
1580
-     * @param string      $message
1581
-     *
1582
-     * @throws InvalidArgumentException
1583
-     *
1584
-     * @return void
1585
-     */
1586
-    public static function nullOrStartsWith($value, $prefix, $message = '')
1587
-    {
1588
-        static::__callStatic('nullOrStartsWith', array($value, $prefix, $message));
1589
-    }
1590
-
1591
-    /**
1592
-     * @psalm-pure
1593
-     *
1594
-     * @param iterable<string> $value
1595
-     * @param string           $prefix
1596
-     * @param string           $message
1597
-     *
1598
-     * @throws InvalidArgumentException
1599
-     *
1600
-     * @return void
1601
-     */
1602
-    public static function allStartsWith($value, $prefix, $message = '')
1603
-    {
1604
-        static::__callStatic('allStartsWith', array($value, $prefix, $message));
1605
-    }
1606
-
1607
-    /**
1608
-     * @psalm-pure
1609
-     *
1610
-     * @param string|null $value
1611
-     * @param string      $prefix
1612
-     * @param string      $message
1613
-     *
1614
-     * @throws InvalidArgumentException
1615
-     *
1616
-     * @return void
1617
-     */
1618
-    public static function nullOrNotStartsWith($value, $prefix, $message = '')
1619
-    {
1620
-        static::__callStatic('nullOrNotStartsWith', array($value, $prefix, $message));
1621
-    }
1622
-
1623
-    /**
1624
-     * @psalm-pure
1625
-     *
1626
-     * @param iterable<string> $value
1627
-     * @param string           $prefix
1628
-     * @param string           $message
1629
-     *
1630
-     * @throws InvalidArgumentException
1631
-     *
1632
-     * @return void
1633
-     */
1634
-    public static function allNotStartsWith($value, $prefix, $message = '')
1635
-    {
1636
-        static::__callStatic('allNotStartsWith', array($value, $prefix, $message));
1637
-    }
1638
-
1639
-    /**
1640
-     * @psalm-pure
1641
-     *
1642
-     * @param mixed  $value
1643
-     * @param string $message
1644
-     *
1645
-     * @throws InvalidArgumentException
1646
-     *
1647
-     * @return void
1648
-     */
1649
-    public static function nullOrStartsWithLetter($value, $message = '')
1650
-    {
1651
-        static::__callStatic('nullOrStartsWithLetter', array($value, $message));
1652
-    }
1653
-
1654
-    /**
1655
-     * @psalm-pure
1656
-     *
1657
-     * @param mixed  $value
1658
-     * @param string $message
1659
-     *
1660
-     * @throws InvalidArgumentException
1661
-     *
1662
-     * @return void
1663
-     */
1664
-    public static function allStartsWithLetter($value, $message = '')
1665
-    {
1666
-        static::__callStatic('allStartsWithLetter', array($value, $message));
1667
-    }
1668
-
1669
-    /**
1670
-     * @psalm-pure
1671
-     *
1672
-     * @param string|null $value
1673
-     * @param string      $suffix
1674
-     * @param string      $message
1675
-     *
1676
-     * @throws InvalidArgumentException
1677
-     *
1678
-     * @return void
1679
-     */
1680
-    public static function nullOrEndsWith($value, $suffix, $message = '')
1681
-    {
1682
-        static::__callStatic('nullOrEndsWith', array($value, $suffix, $message));
1683
-    }
1684
-
1685
-    /**
1686
-     * @psalm-pure
1687
-     *
1688
-     * @param iterable<string> $value
1689
-     * @param string           $suffix
1690
-     * @param string           $message
1691
-     *
1692
-     * @throws InvalidArgumentException
1693
-     *
1694
-     * @return void
1695
-     */
1696
-    public static function allEndsWith($value, $suffix, $message = '')
1697
-    {
1698
-        static::__callStatic('allEndsWith', array($value, $suffix, $message));
1699
-    }
1700
-
1701
-    /**
1702
-     * @psalm-pure
1703
-     *
1704
-     * @param string|null $value
1705
-     * @param string      $suffix
1706
-     * @param string      $message
1707
-     *
1708
-     * @throws InvalidArgumentException
1709
-     *
1710
-     * @return void
1711
-     */
1712
-    public static function nullOrNotEndsWith($value, $suffix, $message = '')
1713
-    {
1714
-        static::__callStatic('nullOrNotEndsWith', array($value, $suffix, $message));
1715
-    }
1716
-
1717
-    /**
1718
-     * @psalm-pure
1719
-     *
1720
-     * @param iterable<string> $value
1721
-     * @param string           $suffix
1722
-     * @param string           $message
1723
-     *
1724
-     * @throws InvalidArgumentException
1725
-     *
1726
-     * @return void
1727
-     */
1728
-    public static function allNotEndsWith($value, $suffix, $message = '')
1729
-    {
1730
-        static::__callStatic('allNotEndsWith', array($value, $suffix, $message));
1731
-    }
1732
-
1733
-    /**
1734
-     * @psalm-pure
1735
-     *
1736
-     * @param string|null $value
1737
-     * @param string      $pattern
1738
-     * @param string      $message
1739
-     *
1740
-     * @throws InvalidArgumentException
1741
-     *
1742
-     * @return void
1743
-     */
1744
-    public static function nullOrRegex($value, $pattern, $message = '')
1745
-    {
1746
-        static::__callStatic('nullOrRegex', array($value, $pattern, $message));
1747
-    }
1748
-
1749
-    /**
1750
-     * @psalm-pure
1751
-     *
1752
-     * @param iterable<string> $value
1753
-     * @param string           $pattern
1754
-     * @param string           $message
1755
-     *
1756
-     * @throws InvalidArgumentException
1757
-     *
1758
-     * @return void
1759
-     */
1760
-    public static function allRegex($value, $pattern, $message = '')
1761
-    {
1762
-        static::__callStatic('allRegex', array($value, $pattern, $message));
1763
-    }
1764
-
1765
-    /**
1766
-     * @psalm-pure
1767
-     *
1768
-     * @param string|null $value
1769
-     * @param string      $pattern
1770
-     * @param string      $message
1771
-     *
1772
-     * @throws InvalidArgumentException
1773
-     *
1774
-     * @return void
1775
-     */
1776
-    public static function nullOrNotRegex($value, $pattern, $message = '')
1777
-    {
1778
-        static::__callStatic('nullOrNotRegex', array($value, $pattern, $message));
1779
-    }
1780
-
1781
-    /**
1782
-     * @psalm-pure
1783
-     *
1784
-     * @param iterable<string> $value
1785
-     * @param string           $pattern
1786
-     * @param string           $message
1787
-     *
1788
-     * @throws InvalidArgumentException
1789
-     *
1790
-     * @return void
1791
-     */
1792
-    public static function allNotRegex($value, $pattern, $message = '')
1793
-    {
1794
-        static::__callStatic('allNotRegex', array($value, $pattern, $message));
1795
-    }
1796
-
1797
-    /**
1798
-     * @psalm-pure
1799
-     *
1800
-     * @param mixed  $value
1801
-     * @param string $message
1802
-     *
1803
-     * @throws InvalidArgumentException
1804
-     *
1805
-     * @return void
1806
-     */
1807
-    public static function nullOrUnicodeLetters($value, $message = '')
1808
-    {
1809
-        static::__callStatic('nullOrUnicodeLetters', array($value, $message));
1810
-    }
1811
-
1812
-    /**
1813
-     * @psalm-pure
1814
-     *
1815
-     * @param mixed  $value
1816
-     * @param string $message
1817
-     *
1818
-     * @throws InvalidArgumentException
1819
-     *
1820
-     * @return void
1821
-     */
1822
-    public static function allUnicodeLetters($value, $message = '')
1823
-    {
1824
-        static::__callStatic('allUnicodeLetters', array($value, $message));
1825
-    }
1826
-
1827
-    /**
1828
-     * @psalm-pure
1829
-     *
1830
-     * @param mixed  $value
1831
-     * @param string $message
1832
-     *
1833
-     * @throws InvalidArgumentException
1834
-     *
1835
-     * @return void
1836
-     */
1837
-    public static function nullOrAlpha($value, $message = '')
1838
-    {
1839
-        static::__callStatic('nullOrAlpha', array($value, $message));
1840
-    }
1841
-
1842
-    /**
1843
-     * @psalm-pure
1844
-     *
1845
-     * @param mixed  $value
1846
-     * @param string $message
1847
-     *
1848
-     * @throws InvalidArgumentException
1849
-     *
1850
-     * @return void
1851
-     */
1852
-    public static function allAlpha($value, $message = '')
1853
-    {
1854
-        static::__callStatic('allAlpha', array($value, $message));
1855
-    }
1856
-
1857
-    /**
1858
-     * @psalm-pure
1859
-     *
1860
-     * @param string|null $value
1861
-     * @param string      $message
1862
-     *
1863
-     * @throws InvalidArgumentException
1864
-     *
1865
-     * @return void
1866
-     */
1867
-    public static function nullOrDigits($value, $message = '')
1868
-    {
1869
-        static::__callStatic('nullOrDigits', array($value, $message));
1870
-    }
1871
-
1872
-    /**
1873
-     * @psalm-pure
1874
-     *
1875
-     * @param iterable<string> $value
1876
-     * @param string           $message
1877
-     *
1878
-     * @throws InvalidArgumentException
1879
-     *
1880
-     * @return void
1881
-     */
1882
-    public static function allDigits($value, $message = '')
1883
-    {
1884
-        static::__callStatic('allDigits', array($value, $message));
1885
-    }
1886
-
1887
-    /**
1888
-     * @psalm-pure
1889
-     *
1890
-     * @param string|null $value
1891
-     * @param string      $message
1892
-     *
1893
-     * @throws InvalidArgumentException
1894
-     *
1895
-     * @return void
1896
-     */
1897
-    public static function nullOrAlnum($value, $message = '')
1898
-    {
1899
-        static::__callStatic('nullOrAlnum', array($value, $message));
1900
-    }
1901
-
1902
-    /**
1903
-     * @psalm-pure
1904
-     *
1905
-     * @param iterable<string> $value
1906
-     * @param string           $message
1907
-     *
1908
-     * @throws InvalidArgumentException
1909
-     *
1910
-     * @return void
1911
-     */
1912
-    public static function allAlnum($value, $message = '')
1913
-    {
1914
-        static::__callStatic('allAlnum', array($value, $message));
1915
-    }
1916
-
1917
-    /**
1918
-     * @psalm-pure
1919
-     * @psalm-assert lowercase-string|null $value
1920
-     *
1921
-     * @param string|null $value
1922
-     * @param string      $message
1923
-     *
1924
-     * @throws InvalidArgumentException
1925
-     *
1926
-     * @return void
1927
-     */
1928
-    public static function nullOrLower($value, $message = '')
1929
-    {
1930
-        static::__callStatic('nullOrLower', array($value, $message));
1931
-    }
1932
-
1933
-    /**
1934
-     * @psalm-pure
1935
-     * @psalm-assert iterable<lowercase-string> $value
1936
-     *
1937
-     * @param iterable<string> $value
1938
-     * @param string           $message
1939
-     *
1940
-     * @throws InvalidArgumentException
1941
-     *
1942
-     * @return void
1943
-     */
1944
-    public static function allLower($value, $message = '')
1945
-    {
1946
-        static::__callStatic('allLower', array($value, $message));
1947
-    }
1948
-
1949
-    /**
1950
-     * @psalm-pure
1951
-     *
1952
-     * @param string|null $value
1953
-     * @param string      $message
1954
-     *
1955
-     * @throws InvalidArgumentException
1956
-     *
1957
-     * @return void
1958
-     */
1959
-    public static function nullOrUpper($value, $message = '')
1960
-    {
1961
-        static::__callStatic('nullOrUpper', array($value, $message));
1962
-    }
1963
-
1964
-    /**
1965
-     * @psalm-pure
1966
-     *
1967
-     * @param iterable<string> $value
1968
-     * @param string           $message
1969
-     *
1970
-     * @throws InvalidArgumentException
1971
-     *
1972
-     * @return void
1973
-     */
1974
-    public static function allUpper($value, $message = '')
1975
-    {
1976
-        static::__callStatic('allUpper', array($value, $message));
1977
-    }
1978
-
1979
-    /**
1980
-     * @psalm-pure
1981
-     *
1982
-     * @param string|null $value
1983
-     * @param int         $length
1984
-     * @param string      $message
1985
-     *
1986
-     * @throws InvalidArgumentException
1987
-     *
1988
-     * @return void
1989
-     */
1990
-    public static function nullOrLength($value, $length, $message = '')
1991
-    {
1992
-        static::__callStatic('nullOrLength', array($value, $length, $message));
1993
-    }
1994
-
1995
-    /**
1996
-     * @psalm-pure
1997
-     *
1998
-     * @param iterable<string> $value
1999
-     * @param int              $length
2000
-     * @param string           $message
2001
-     *
2002
-     * @throws InvalidArgumentException
2003
-     *
2004
-     * @return void
2005
-     */
2006
-    public static function allLength($value, $length, $message = '')
2007
-    {
2008
-        static::__callStatic('allLength', array($value, $length, $message));
2009
-    }
2010
-
2011
-    /**
2012
-     * @psalm-pure
2013
-     *
2014
-     * @param string|null $value
2015
-     * @param int|float   $min
2016
-     * @param string      $message
2017
-     *
2018
-     * @throws InvalidArgumentException
2019
-     *
2020
-     * @return void
2021
-     */
2022
-    public static function nullOrMinLength($value, $min, $message = '')
2023
-    {
2024
-        static::__callStatic('nullOrMinLength', array($value, $min, $message));
2025
-    }
2026
-
2027
-    /**
2028
-     * @psalm-pure
2029
-     *
2030
-     * @param iterable<string> $value
2031
-     * @param int|float        $min
2032
-     * @param string           $message
2033
-     *
2034
-     * @throws InvalidArgumentException
2035
-     *
2036
-     * @return void
2037
-     */
2038
-    public static function allMinLength($value, $min, $message = '')
2039
-    {
2040
-        static::__callStatic('allMinLength', array($value, $min, $message));
2041
-    }
2042
-
2043
-    /**
2044
-     * @psalm-pure
2045
-     *
2046
-     * @param string|null $value
2047
-     * @param int|float   $max
2048
-     * @param string      $message
2049
-     *
2050
-     * @throws InvalidArgumentException
2051
-     *
2052
-     * @return void
2053
-     */
2054
-    public static function nullOrMaxLength($value, $max, $message = '')
2055
-    {
2056
-        static::__callStatic('nullOrMaxLength', array($value, $max, $message));
2057
-    }
2058
-
2059
-    /**
2060
-     * @psalm-pure
2061
-     *
2062
-     * @param iterable<string> $value
2063
-     * @param int|float        $max
2064
-     * @param string           $message
2065
-     *
2066
-     * @throws InvalidArgumentException
2067
-     *
2068
-     * @return void
2069
-     */
2070
-    public static function allMaxLength($value, $max, $message = '')
2071
-    {
2072
-        static::__callStatic('allMaxLength', array($value, $max, $message));
2073
-    }
2074
-
2075
-    /**
2076
-     * @psalm-pure
2077
-     *
2078
-     * @param string|null $value
2079
-     * @param int|float   $min
2080
-     * @param int|float   $max
2081
-     * @param string      $message
2082
-     *
2083
-     * @throws InvalidArgumentException
2084
-     *
2085
-     * @return void
2086
-     */
2087
-    public static function nullOrLengthBetween($value, $min, $max, $message = '')
2088
-    {
2089
-        static::__callStatic('nullOrLengthBetween', array($value, $min, $max, $message));
2090
-    }
2091
-
2092
-    /**
2093
-     * @psalm-pure
2094
-     *
2095
-     * @param iterable<string> $value
2096
-     * @param int|float        $min
2097
-     * @param int|float        $max
2098
-     * @param string           $message
2099
-     *
2100
-     * @throws InvalidArgumentException
2101
-     *
2102
-     * @return void
2103
-     */
2104
-    public static function allLengthBetween($value, $min, $max, $message = '')
2105
-    {
2106
-        static::__callStatic('allLengthBetween', array($value, $min, $max, $message));
2107
-    }
2108
-
2109
-    /**
2110
-     * @param mixed  $value
2111
-     * @param string $message
2112
-     *
2113
-     * @throws InvalidArgumentException
2114
-     *
2115
-     * @return void
2116
-     */
2117
-    public static function nullOrFileExists($value, $message = '')
2118
-    {
2119
-        static::__callStatic('nullOrFileExists', array($value, $message));
2120
-    }
2121
-
2122
-    /**
2123
-     * @param mixed  $value
2124
-     * @param string $message
2125
-     *
2126
-     * @throws InvalidArgumentException
2127
-     *
2128
-     * @return void
2129
-     */
2130
-    public static function allFileExists($value, $message = '')
2131
-    {
2132
-        static::__callStatic('allFileExists', array($value, $message));
2133
-    }
2134
-
2135
-    /**
2136
-     * @param mixed  $value
2137
-     * @param string $message
2138
-     *
2139
-     * @throws InvalidArgumentException
2140
-     *
2141
-     * @return void
2142
-     */
2143
-    public static function nullOrFile($value, $message = '')
2144
-    {
2145
-        static::__callStatic('nullOrFile', array($value, $message));
2146
-    }
2147
-
2148
-    /**
2149
-     * @param mixed  $value
2150
-     * @param string $message
2151
-     *
2152
-     * @throws InvalidArgumentException
2153
-     *
2154
-     * @return void
2155
-     */
2156
-    public static function allFile($value, $message = '')
2157
-    {
2158
-        static::__callStatic('allFile', array($value, $message));
2159
-    }
2160
-
2161
-    /**
2162
-     * @param mixed  $value
2163
-     * @param string $message
2164
-     *
2165
-     * @throws InvalidArgumentException
2166
-     *
2167
-     * @return void
2168
-     */
2169
-    public static function nullOrDirectory($value, $message = '')
2170
-    {
2171
-        static::__callStatic('nullOrDirectory', array($value, $message));
2172
-    }
2173
-
2174
-    /**
2175
-     * @param mixed  $value
2176
-     * @param string $message
2177
-     *
2178
-     * @throws InvalidArgumentException
2179
-     *
2180
-     * @return void
2181
-     */
2182
-    public static function allDirectory($value, $message = '')
2183
-    {
2184
-        static::__callStatic('allDirectory', array($value, $message));
2185
-    }
2186
-
2187
-    /**
2188
-     * @param string|null $value
2189
-     * @param string      $message
2190
-     *
2191
-     * @throws InvalidArgumentException
2192
-     *
2193
-     * @return void
2194
-     */
2195
-    public static function nullOrReadable($value, $message = '')
2196
-    {
2197
-        static::__callStatic('nullOrReadable', array($value, $message));
2198
-    }
2199
-
2200
-    /**
2201
-     * @param iterable<string> $value
2202
-     * @param string           $message
2203
-     *
2204
-     * @throws InvalidArgumentException
2205
-     *
2206
-     * @return void
2207
-     */
2208
-    public static function allReadable($value, $message = '')
2209
-    {
2210
-        static::__callStatic('allReadable', array($value, $message));
2211
-    }
2212
-
2213
-    /**
2214
-     * @param string|null $value
2215
-     * @param string      $message
2216
-     *
2217
-     * @throws InvalidArgumentException
2218
-     *
2219
-     * @return void
2220
-     */
2221
-    public static function nullOrWritable($value, $message = '')
2222
-    {
2223
-        static::__callStatic('nullOrWritable', array($value, $message));
2224
-    }
2225
-
2226
-    /**
2227
-     * @param iterable<string> $value
2228
-     * @param string           $message
2229
-     *
2230
-     * @throws InvalidArgumentException
2231
-     *
2232
-     * @return void
2233
-     */
2234
-    public static function allWritable($value, $message = '')
2235
-    {
2236
-        static::__callStatic('allWritable', array($value, $message));
2237
-    }
2238
-
2239
-    /**
2240
-     * @psalm-assert class-string|null $value
2241
-     *
2242
-     * @param mixed  $value
2243
-     * @param string $message
2244
-     *
2245
-     * @throws InvalidArgumentException
2246
-     *
2247
-     * @return void
2248
-     */
2249
-    public static function nullOrClassExists($value, $message = '')
2250
-    {
2251
-        static::__callStatic('nullOrClassExists', array($value, $message));
2252
-    }
2253
-
2254
-    /**
2255
-     * @psalm-assert iterable<class-string> $value
2256
-     *
2257
-     * @param mixed  $value
2258
-     * @param string $message
2259
-     *
2260
-     * @throws InvalidArgumentException
2261
-     *
2262
-     * @return void
2263
-     */
2264
-    public static function allClassExists($value, $message = '')
2265
-    {
2266
-        static::__callStatic('allClassExists', array($value, $message));
2267
-    }
2268
-
2269
-    /**
2270
-     * @psalm-pure
2271
-     * @psalm-template ExpectedType of object
2272
-     * @psalm-param class-string<ExpectedType> $class
2273
-     * @psalm-assert class-string<ExpectedType>|ExpectedType|null $value
2274
-     *
2275
-     * @param mixed         $value
2276
-     * @param string|object $class
2277
-     * @param string        $message
2278
-     *
2279
-     * @throws InvalidArgumentException
2280
-     *
2281
-     * @return void
2282
-     */
2283
-    public static function nullOrSubclassOf($value, $class, $message = '')
2284
-    {
2285
-        static::__callStatic('nullOrSubclassOf', array($value, $class, $message));
2286
-    }
2287
-
2288
-    /**
2289
-     * @psalm-pure
2290
-     * @psalm-template ExpectedType of object
2291
-     * @psalm-param class-string<ExpectedType> $class
2292
-     * @psalm-assert iterable<class-string<ExpectedType>|ExpectedType> $value
2293
-     *
2294
-     * @param mixed         $value
2295
-     * @param string|object $class
2296
-     * @param string        $message
2297
-     *
2298
-     * @throws InvalidArgumentException
2299
-     *
2300
-     * @return void
2301
-     */
2302
-    public static function allSubclassOf($value, $class, $message = '')
2303
-    {
2304
-        static::__callStatic('allSubclassOf', array($value, $class, $message));
2305
-    }
2306
-
2307
-    /**
2308
-     * @psalm-assert class-string|null $value
2309
-     *
2310
-     * @param mixed  $value
2311
-     * @param string $message
2312
-     *
2313
-     * @throws InvalidArgumentException
2314
-     *
2315
-     * @return void
2316
-     */
2317
-    public static function nullOrInterfaceExists($value, $message = '')
2318
-    {
2319
-        static::__callStatic('nullOrInterfaceExists', array($value, $message));
2320
-    }
2321
-
2322
-    /**
2323
-     * @psalm-assert iterable<class-string> $value
2324
-     *
2325
-     * @param mixed  $value
2326
-     * @param string $message
2327
-     *
2328
-     * @throws InvalidArgumentException
2329
-     *
2330
-     * @return void
2331
-     */
2332
-    public static function allInterfaceExists($value, $message = '')
2333
-    {
2334
-        static::__callStatic('allInterfaceExists', array($value, $message));
2335
-    }
2336
-
2337
-    /**
2338
-     * @psalm-pure
2339
-     * @psalm-template ExpectedType of object
2340
-     * @psalm-param class-string<ExpectedType> $interface
2341
-     * @psalm-assert class-string<ExpectedType>|null $value
2342
-     *
2343
-     * @param mixed  $value
2344
-     * @param mixed  $interface
2345
-     * @param string $message
2346
-     *
2347
-     * @throws InvalidArgumentException
2348
-     *
2349
-     * @return void
2350
-     */
2351
-    public static function nullOrImplementsInterface($value, $interface, $message = '')
2352
-    {
2353
-        static::__callStatic('nullOrImplementsInterface', array($value, $interface, $message));
2354
-    }
2355
-
2356
-    /**
2357
-     * @psalm-pure
2358
-     * @psalm-template ExpectedType of object
2359
-     * @psalm-param class-string<ExpectedType> $interface
2360
-     * @psalm-assert iterable<class-string<ExpectedType>> $value
2361
-     *
2362
-     * @param mixed  $value
2363
-     * @param mixed  $interface
2364
-     * @param string $message
2365
-     *
2366
-     * @throws InvalidArgumentException
2367
-     *
2368
-     * @return void
2369
-     */
2370
-    public static function allImplementsInterface($value, $interface, $message = '')
2371
-    {
2372
-        static::__callStatic('allImplementsInterface', array($value, $interface, $message));
2373
-    }
2374
-
2375
-    /**
2376
-     * @psalm-pure
2377
-     * @psalm-param class-string|object|null $classOrObject
2378
-     *
2379
-     * @param string|object|null $classOrObject
2380
-     * @param mixed              $property
2381
-     * @param string             $message
2382
-     *
2383
-     * @throws InvalidArgumentException
2384
-     *
2385
-     * @return void
2386
-     */
2387
-    public static function nullOrPropertyExists($classOrObject, $property, $message = '')
2388
-    {
2389
-        static::__callStatic('nullOrPropertyExists', array($classOrObject, $property, $message));
2390
-    }
2391
-
2392
-    /**
2393
-     * @psalm-pure
2394
-     * @psalm-param iterable<class-string|object> $classOrObject
2395
-     *
2396
-     * @param iterable<string|object> $classOrObject
2397
-     * @param mixed                   $property
2398
-     * @param string                  $message
2399
-     *
2400
-     * @throws InvalidArgumentException
2401
-     *
2402
-     * @return void
2403
-     */
2404
-    public static function allPropertyExists($classOrObject, $property, $message = '')
2405
-    {
2406
-        static::__callStatic('allPropertyExists', array($classOrObject, $property, $message));
2407
-    }
2408
-
2409
-    /**
2410
-     * @psalm-pure
2411
-     * @psalm-param class-string|object|null $classOrObject
2412
-     *
2413
-     * @param string|object|null $classOrObject
2414
-     * @param mixed              $property
2415
-     * @param string             $message
2416
-     *
2417
-     * @throws InvalidArgumentException
2418
-     *
2419
-     * @return void
2420
-     */
2421
-    public static function nullOrPropertyNotExists($classOrObject, $property, $message = '')
2422
-    {
2423
-        static::__callStatic('nullOrPropertyNotExists', array($classOrObject, $property, $message));
2424
-    }
2425
-
2426
-    /**
2427
-     * @psalm-pure
2428
-     * @psalm-param iterable<class-string|object> $classOrObject
2429
-     *
2430
-     * @param iterable<string|object> $classOrObject
2431
-     * @param mixed                   $property
2432
-     * @param string                  $message
2433
-     *
2434
-     * @throws InvalidArgumentException
2435
-     *
2436
-     * @return void
2437
-     */
2438
-    public static function allPropertyNotExists($classOrObject, $property, $message = '')
2439
-    {
2440
-        static::__callStatic('allPropertyNotExists', array($classOrObject, $property, $message));
2441
-    }
2442
-
2443
-    /**
2444
-     * @psalm-pure
2445
-     * @psalm-param class-string|object|null $classOrObject
2446
-     *
2447
-     * @param string|object|null $classOrObject
2448
-     * @param mixed              $method
2449
-     * @param string             $message
2450
-     *
2451
-     * @throws InvalidArgumentException
2452
-     *
2453
-     * @return void
2454
-     */
2455
-    public static function nullOrMethodExists($classOrObject, $method, $message = '')
2456
-    {
2457
-        static::__callStatic('nullOrMethodExists', array($classOrObject, $method, $message));
2458
-    }
2459
-
2460
-    /**
2461
-     * @psalm-pure
2462
-     * @psalm-param iterable<class-string|object> $classOrObject
2463
-     *
2464
-     * @param iterable<string|object> $classOrObject
2465
-     * @param mixed                   $method
2466
-     * @param string                  $message
2467
-     *
2468
-     * @throws InvalidArgumentException
2469
-     *
2470
-     * @return void
2471
-     */
2472
-    public static function allMethodExists($classOrObject, $method, $message = '')
2473
-    {
2474
-        static::__callStatic('allMethodExists', array($classOrObject, $method, $message));
2475
-    }
2476
-
2477
-    /**
2478
-     * @psalm-pure
2479
-     * @psalm-param class-string|object|null $classOrObject
2480
-     *
2481
-     * @param string|object|null $classOrObject
2482
-     * @param mixed              $method
2483
-     * @param string             $message
2484
-     *
2485
-     * @throws InvalidArgumentException
2486
-     *
2487
-     * @return void
2488
-     */
2489
-    public static function nullOrMethodNotExists($classOrObject, $method, $message = '')
2490
-    {
2491
-        static::__callStatic('nullOrMethodNotExists', array($classOrObject, $method, $message));
2492
-    }
2493
-
2494
-    /**
2495
-     * @psalm-pure
2496
-     * @psalm-param iterable<class-string|object> $classOrObject
2497
-     *
2498
-     * @param iterable<string|object> $classOrObject
2499
-     * @param mixed                   $method
2500
-     * @param string                  $message
2501
-     *
2502
-     * @throws InvalidArgumentException
2503
-     *
2504
-     * @return void
2505
-     */
2506
-    public static function allMethodNotExists($classOrObject, $method, $message = '')
2507
-    {
2508
-        static::__callStatic('allMethodNotExists', array($classOrObject, $method, $message));
2509
-    }
2510
-
2511
-    /**
2512
-     * @psalm-pure
2513
-     *
2514
-     * @param array|null $array
2515
-     * @param string|int $key
2516
-     * @param string     $message
2517
-     *
2518
-     * @throws InvalidArgumentException
2519
-     *
2520
-     * @return void
2521
-     */
2522
-    public static function nullOrKeyExists($array, $key, $message = '')
2523
-    {
2524
-        static::__callStatic('nullOrKeyExists', array($array, $key, $message));
2525
-    }
2526
-
2527
-    /**
2528
-     * @psalm-pure
2529
-     *
2530
-     * @param iterable<array> $array
2531
-     * @param string|int      $key
2532
-     * @param string          $message
2533
-     *
2534
-     * @throws InvalidArgumentException
2535
-     *
2536
-     * @return void
2537
-     */
2538
-    public static function allKeyExists($array, $key, $message = '')
2539
-    {
2540
-        static::__callStatic('allKeyExists', array($array, $key, $message));
2541
-    }
2542
-
2543
-    /**
2544
-     * @psalm-pure
2545
-     *
2546
-     * @param array|null $array
2547
-     * @param string|int $key
2548
-     * @param string     $message
2549
-     *
2550
-     * @throws InvalidArgumentException
2551
-     *
2552
-     * @return void
2553
-     */
2554
-    public static function nullOrKeyNotExists($array, $key, $message = '')
2555
-    {
2556
-        static::__callStatic('nullOrKeyNotExists', array($array, $key, $message));
2557
-    }
2558
-
2559
-    /**
2560
-     * @psalm-pure
2561
-     *
2562
-     * @param iterable<array> $array
2563
-     * @param string|int      $key
2564
-     * @param string          $message
2565
-     *
2566
-     * @throws InvalidArgumentException
2567
-     *
2568
-     * @return void
2569
-     */
2570
-    public static function allKeyNotExists($array, $key, $message = '')
2571
-    {
2572
-        static::__callStatic('allKeyNotExists', array($array, $key, $message));
2573
-    }
2574
-
2575
-    /**
2576
-     * @psalm-pure
2577
-     * @psalm-assert array-key|null $value
2578
-     *
2579
-     * @param mixed  $value
2580
-     * @param string $message
2581
-     *
2582
-     * @throws InvalidArgumentException
2583
-     *
2584
-     * @return void
2585
-     */
2586
-    public static function nullOrValidArrayKey($value, $message = '')
2587
-    {
2588
-        static::__callStatic('nullOrValidArrayKey', array($value, $message));
2589
-    }
2590
-
2591
-    /**
2592
-     * @psalm-pure
2593
-     * @psalm-assert iterable<array-key> $value
2594
-     *
2595
-     * @param mixed  $value
2596
-     * @param string $message
2597
-     *
2598
-     * @throws InvalidArgumentException
2599
-     *
2600
-     * @return void
2601
-     */
2602
-    public static function allValidArrayKey($value, $message = '')
2603
-    {
2604
-        static::__callStatic('allValidArrayKey', array($value, $message));
2605
-    }
2606
-
2607
-    /**
2608
-     * @param Countable|array|null $array
2609
-     * @param int                  $number
2610
-     * @param string               $message
2611
-     *
2612
-     * @throws InvalidArgumentException
2613
-     *
2614
-     * @return void
2615
-     */
2616
-    public static function nullOrCount($array, $number, $message = '')
2617
-    {
2618
-        static::__callStatic('nullOrCount', array($array, $number, $message));
2619
-    }
2620
-
2621
-    /**
2622
-     * @param iterable<Countable|array> $array
2623
-     * @param int                       $number
2624
-     * @param string                    $message
2625
-     *
2626
-     * @throws InvalidArgumentException
2627
-     *
2628
-     * @return void
2629
-     */
2630
-    public static function allCount($array, $number, $message = '')
2631
-    {
2632
-        static::__callStatic('allCount', array($array, $number, $message));
2633
-    }
2634
-
2635
-    /**
2636
-     * @param Countable|array|null $array
2637
-     * @param int|float            $min
2638
-     * @param string               $message
2639
-     *
2640
-     * @throws InvalidArgumentException
2641
-     *
2642
-     * @return void
2643
-     */
2644
-    public static function nullOrMinCount($array, $min, $message = '')
2645
-    {
2646
-        static::__callStatic('nullOrMinCount', array($array, $min, $message));
2647
-    }
2648
-
2649
-    /**
2650
-     * @param iterable<Countable|array> $array
2651
-     * @param int|float                 $min
2652
-     * @param string                    $message
2653
-     *
2654
-     * @throws InvalidArgumentException
2655
-     *
2656
-     * @return void
2657
-     */
2658
-    public static function allMinCount($array, $min, $message = '')
2659
-    {
2660
-        static::__callStatic('allMinCount', array($array, $min, $message));
2661
-    }
2662
-
2663
-    /**
2664
-     * @param Countable|array|null $array
2665
-     * @param int|float            $max
2666
-     * @param string               $message
2667
-     *
2668
-     * @throws InvalidArgumentException
2669
-     *
2670
-     * @return void
2671
-     */
2672
-    public static function nullOrMaxCount($array, $max, $message = '')
2673
-    {
2674
-        static::__callStatic('nullOrMaxCount', array($array, $max, $message));
2675
-    }
2676
-
2677
-    /**
2678
-     * @param iterable<Countable|array> $array
2679
-     * @param int|float                 $max
2680
-     * @param string                    $message
2681
-     *
2682
-     * @throws InvalidArgumentException
2683
-     *
2684
-     * @return void
2685
-     */
2686
-    public static function allMaxCount($array, $max, $message = '')
2687
-    {
2688
-        static::__callStatic('allMaxCount', array($array, $max, $message));
2689
-    }
2690
-
2691
-    /**
2692
-     * @param Countable|array|null $array
2693
-     * @param int|float            $min
2694
-     * @param int|float            $max
2695
-     * @param string               $message
2696
-     *
2697
-     * @throws InvalidArgumentException
2698
-     *
2699
-     * @return void
2700
-     */
2701
-    public static function nullOrCountBetween($array, $min, $max, $message = '')
2702
-    {
2703
-        static::__callStatic('nullOrCountBetween', array($array, $min, $max, $message));
2704
-    }
2705
-
2706
-    /**
2707
-     * @param iterable<Countable|array> $array
2708
-     * @param int|float                 $min
2709
-     * @param int|float                 $max
2710
-     * @param string                    $message
2711
-     *
2712
-     * @throws InvalidArgumentException
2713
-     *
2714
-     * @return void
2715
-     */
2716
-    public static function allCountBetween($array, $min, $max, $message = '')
2717
-    {
2718
-        static::__callStatic('allCountBetween', array($array, $min, $max, $message));
2719
-    }
2720
-
2721
-    /**
2722
-     * @psalm-pure
2723
-     * @psalm-assert list|null $array
2724
-     *
2725
-     * @param mixed  $array
2726
-     * @param string $message
2727
-     *
2728
-     * @throws InvalidArgumentException
2729
-     *
2730
-     * @return void
2731
-     */
2732
-    public static function nullOrIsList($array, $message = '')
2733
-    {
2734
-        static::__callStatic('nullOrIsList', array($array, $message));
2735
-    }
2736
-
2737
-    /**
2738
-     * @psalm-pure
2739
-     * @psalm-assert iterable<list> $array
2740
-     *
2741
-     * @param mixed  $array
2742
-     * @param string $message
2743
-     *
2744
-     * @throws InvalidArgumentException
2745
-     *
2746
-     * @return void
2747
-     */
2748
-    public static function allIsList($array, $message = '')
2749
-    {
2750
-        static::__callStatic('allIsList', array($array, $message));
2751
-    }
2752
-
2753
-    /**
2754
-     * @psalm-pure
2755
-     * @psalm-assert non-empty-list|null $array
2756
-     *
2757
-     * @param mixed  $array
2758
-     * @param string $message
2759
-     *
2760
-     * @throws InvalidArgumentException
2761
-     *
2762
-     * @return void
2763
-     */
2764
-    public static function nullOrIsNonEmptyList($array, $message = '')
2765
-    {
2766
-        static::__callStatic('nullOrIsNonEmptyList', array($array, $message));
2767
-    }
2768
-
2769
-    /**
2770
-     * @psalm-pure
2771
-     * @psalm-assert iterable<non-empty-list> $array
2772
-     *
2773
-     * @param mixed  $array
2774
-     * @param string $message
2775
-     *
2776
-     * @throws InvalidArgumentException
2777
-     *
2778
-     * @return void
2779
-     */
2780
-    public static function allIsNonEmptyList($array, $message = '')
2781
-    {
2782
-        static::__callStatic('allIsNonEmptyList', array($array, $message));
2783
-    }
2784
-
2785
-    /**
2786
-     * @psalm-pure
2787
-     * @psalm-template T
2788
-     * @psalm-param mixed|array<T>|null $array
2789
-     * @psalm-assert array<string, T>|null $array
2790
-     *
2791
-     * @param mixed  $array
2792
-     * @param string $message
2793
-     *
2794
-     * @throws InvalidArgumentException
2795
-     *
2796
-     * @return void
2797
-     */
2798
-    public static function nullOrIsMap($array, $message = '')
2799
-    {
2800
-        static::__callStatic('nullOrIsMap', array($array, $message));
2801
-    }
2802
-
2803
-    /**
2804
-     * @psalm-pure
2805
-     * @psalm-template T
2806
-     * @psalm-param iterable<mixed|array<T>> $array
2807
-     * @psalm-assert iterable<array<string, T>> $array
2808
-     *
2809
-     * @param mixed  $array
2810
-     * @param string $message
2811
-     *
2812
-     * @throws InvalidArgumentException
2813
-     *
2814
-     * @return void
2815
-     */
2816
-    public static function allIsMap($array, $message = '')
2817
-    {
2818
-        static::__callStatic('allIsMap', array($array, $message));
2819
-    }
2820
-
2821
-    /**
2822
-     * @psalm-pure
2823
-     * @psalm-template T
2824
-     * @psalm-param mixed|array<T>|null $array
2825
-     *
2826
-     * @param mixed  $array
2827
-     * @param string $message
2828
-     *
2829
-     * @throws InvalidArgumentException
2830
-     *
2831
-     * @return void
2832
-     */
2833
-    public static function nullOrIsNonEmptyMap($array, $message = '')
2834
-    {
2835
-        static::__callStatic('nullOrIsNonEmptyMap', array($array, $message));
2836
-    }
2837
-
2838
-    /**
2839
-     * @psalm-pure
2840
-     * @psalm-template T
2841
-     * @psalm-param iterable<mixed|array<T>> $array
2842
-     *
2843
-     * @param mixed  $array
2844
-     * @param string $message
2845
-     *
2846
-     * @throws InvalidArgumentException
2847
-     *
2848
-     * @return void
2849
-     */
2850
-    public static function allIsNonEmptyMap($array, $message = '')
2851
-    {
2852
-        static::__callStatic('allIsNonEmptyMap', array($array, $message));
2853
-    }
2854
-
2855
-    /**
2856
-     * @psalm-pure
2857
-     *
2858
-     * @param string|null $value
2859
-     * @param string      $message
2860
-     *
2861
-     * @throws InvalidArgumentException
2862
-     *
2863
-     * @return void
2864
-     */
2865
-    public static function nullOrUuid($value, $message = '')
2866
-    {
2867
-        static::__callStatic('nullOrUuid', array($value, $message));
2868
-    }
2869
-
2870
-    /**
2871
-     * @psalm-pure
2872
-     *
2873
-     * @param iterable<string> $value
2874
-     * @param string           $message
2875
-     *
2876
-     * @throws InvalidArgumentException
2877
-     *
2878
-     * @return void
2879
-     */
2880
-    public static function allUuid($value, $message = '')
2881
-    {
2882
-        static::__callStatic('allUuid', array($value, $message));
2883
-    }
2884
-
2885
-    /**
2886
-     * @psalm-param class-string<Throwable> $class
2887
-     *
2888
-     * @param Closure|null $expression
2889
-     * @param string       $class
2890
-     * @param string       $message
2891
-     *
2892
-     * @throws InvalidArgumentException
2893
-     *
2894
-     * @return void
2895
-     */
2896
-    public static function nullOrThrows($expression, $class = 'Exception', $message = '')
2897
-    {
2898
-        static::__callStatic('nullOrThrows', array($expression, $class, $message));
2899
-    }
2900
-
2901
-    /**
2902
-     * @psalm-param class-string<Throwable> $class
2903
-     *
2904
-     * @param iterable<Closure> $expression
2905
-     * @param string            $class
2906
-     * @param string            $message
2907
-     *
2908
-     * @throws InvalidArgumentException
2909
-     *
2910
-     * @return void
2911
-     */
2912
-    public static function allThrows($expression, $class = 'Exception', $message = '')
2913
-    {
2914
-        static::__callStatic('allThrows', array($expression, $class, $message));
2915
-    }
20
+	/**
21
+	 * @psalm-pure
22
+	 * @psalm-assert string|null $value
23
+	 *
24
+	 * @param mixed  $value
25
+	 * @param string $message
26
+	 *
27
+	 * @throws InvalidArgumentException
28
+	 *
29
+	 * @return void
30
+	 */
31
+	public static function nullOrString($value, $message = '')
32
+	{
33
+		static::__callStatic('nullOrString', array($value, $message));
34
+	}
35
+
36
+	/**
37
+	 * @psalm-pure
38
+	 * @psalm-assert iterable<string> $value
39
+	 *
40
+	 * @param mixed  $value
41
+	 * @param string $message
42
+	 *
43
+	 * @throws InvalidArgumentException
44
+	 *
45
+	 * @return void
46
+	 */
47
+	public static function allString($value, $message = '')
48
+	{
49
+		static::__callStatic('allString', array($value, $message));
50
+	}
51
+
52
+	/**
53
+	 * @psalm-pure
54
+	 * @psalm-assert non-empty-string|null $value
55
+	 *
56
+	 * @param mixed  $value
57
+	 * @param string $message
58
+	 *
59
+	 * @throws InvalidArgumentException
60
+	 *
61
+	 * @return void
62
+	 */
63
+	public static function nullOrStringNotEmpty($value, $message = '')
64
+	{
65
+		static::__callStatic('nullOrStringNotEmpty', array($value, $message));
66
+	}
67
+
68
+	/**
69
+	 * @psalm-pure
70
+	 * @psalm-assert iterable<non-empty-string> $value
71
+	 *
72
+	 * @param mixed  $value
73
+	 * @param string $message
74
+	 *
75
+	 * @throws InvalidArgumentException
76
+	 *
77
+	 * @return void
78
+	 */
79
+	public static function allStringNotEmpty($value, $message = '')
80
+	{
81
+		static::__callStatic('allStringNotEmpty', array($value, $message));
82
+	}
83
+
84
+	/**
85
+	 * @psalm-pure
86
+	 * @psalm-assert int|null $value
87
+	 *
88
+	 * @param mixed  $value
89
+	 * @param string $message
90
+	 *
91
+	 * @throws InvalidArgumentException
92
+	 *
93
+	 * @return void
94
+	 */
95
+	public static function nullOrInteger($value, $message = '')
96
+	{
97
+		static::__callStatic('nullOrInteger', array($value, $message));
98
+	}
99
+
100
+	/**
101
+	 * @psalm-pure
102
+	 * @psalm-assert iterable<int> $value
103
+	 *
104
+	 * @param mixed  $value
105
+	 * @param string $message
106
+	 *
107
+	 * @throws InvalidArgumentException
108
+	 *
109
+	 * @return void
110
+	 */
111
+	public static function allInteger($value, $message = '')
112
+	{
113
+		static::__callStatic('allInteger', array($value, $message));
114
+	}
115
+
116
+	/**
117
+	 * @psalm-pure
118
+	 * @psalm-assert numeric|null $value
119
+	 *
120
+	 * @param mixed  $value
121
+	 * @param string $message
122
+	 *
123
+	 * @throws InvalidArgumentException
124
+	 *
125
+	 * @return void
126
+	 */
127
+	public static function nullOrIntegerish($value, $message = '')
128
+	{
129
+		static::__callStatic('nullOrIntegerish', array($value, $message));
130
+	}
131
+
132
+	/**
133
+	 * @psalm-pure
134
+	 * @psalm-assert iterable<numeric> $value
135
+	 *
136
+	 * @param mixed  $value
137
+	 * @param string $message
138
+	 *
139
+	 * @throws InvalidArgumentException
140
+	 *
141
+	 * @return void
142
+	 */
143
+	public static function allIntegerish($value, $message = '')
144
+	{
145
+		static::__callStatic('allIntegerish', array($value, $message));
146
+	}
147
+
148
+	/**
149
+	 * @psalm-pure
150
+	 * @psalm-assert positive-int|null $value
151
+	 *
152
+	 * @param mixed  $value
153
+	 * @param string $message
154
+	 *
155
+	 * @throws InvalidArgumentException
156
+	 *
157
+	 * @return void
158
+	 */
159
+	public static function nullOrPositiveInteger($value, $message = '')
160
+	{
161
+		static::__callStatic('nullOrPositiveInteger', array($value, $message));
162
+	}
163
+
164
+	/**
165
+	 * @psalm-pure
166
+	 * @psalm-assert iterable<positive-int> $value
167
+	 *
168
+	 * @param mixed  $value
169
+	 * @param string $message
170
+	 *
171
+	 * @throws InvalidArgumentException
172
+	 *
173
+	 * @return void
174
+	 */
175
+	public static function allPositiveInteger($value, $message = '')
176
+	{
177
+		static::__callStatic('allPositiveInteger', array($value, $message));
178
+	}
179
+
180
+	/**
181
+	 * @psalm-pure
182
+	 * @psalm-assert float|null $value
183
+	 *
184
+	 * @param mixed  $value
185
+	 * @param string $message
186
+	 *
187
+	 * @throws InvalidArgumentException
188
+	 *
189
+	 * @return void
190
+	 */
191
+	public static function nullOrFloat($value, $message = '')
192
+	{
193
+		static::__callStatic('nullOrFloat', array($value, $message));
194
+	}
195
+
196
+	/**
197
+	 * @psalm-pure
198
+	 * @psalm-assert iterable<float> $value
199
+	 *
200
+	 * @param mixed  $value
201
+	 * @param string $message
202
+	 *
203
+	 * @throws InvalidArgumentException
204
+	 *
205
+	 * @return void
206
+	 */
207
+	public static function allFloat($value, $message = '')
208
+	{
209
+		static::__callStatic('allFloat', array($value, $message));
210
+	}
211
+
212
+	/**
213
+	 * @psalm-pure
214
+	 * @psalm-assert numeric|null $value
215
+	 *
216
+	 * @param mixed  $value
217
+	 * @param string $message
218
+	 *
219
+	 * @throws InvalidArgumentException
220
+	 *
221
+	 * @return void
222
+	 */
223
+	public static function nullOrNumeric($value, $message = '')
224
+	{
225
+		static::__callStatic('nullOrNumeric', array($value, $message));
226
+	}
227
+
228
+	/**
229
+	 * @psalm-pure
230
+	 * @psalm-assert iterable<numeric> $value
231
+	 *
232
+	 * @param mixed  $value
233
+	 * @param string $message
234
+	 *
235
+	 * @throws InvalidArgumentException
236
+	 *
237
+	 * @return void
238
+	 */
239
+	public static function allNumeric($value, $message = '')
240
+	{
241
+		static::__callStatic('allNumeric', array($value, $message));
242
+	}
243
+
244
+	/**
245
+	 * @psalm-pure
246
+	 * @psalm-assert positive-int|0|null $value
247
+	 *
248
+	 * @param mixed  $value
249
+	 * @param string $message
250
+	 *
251
+	 * @throws InvalidArgumentException
252
+	 *
253
+	 * @return void
254
+	 */
255
+	public static function nullOrNatural($value, $message = '')
256
+	{
257
+		static::__callStatic('nullOrNatural', array($value, $message));
258
+	}
259
+
260
+	/**
261
+	 * @psalm-pure
262
+	 * @psalm-assert iterable<positive-int|0> $value
263
+	 *
264
+	 * @param mixed  $value
265
+	 * @param string $message
266
+	 *
267
+	 * @throws InvalidArgumentException
268
+	 *
269
+	 * @return void
270
+	 */
271
+	public static function allNatural($value, $message = '')
272
+	{
273
+		static::__callStatic('allNatural', array($value, $message));
274
+	}
275
+
276
+	/**
277
+	 * @psalm-pure
278
+	 * @psalm-assert bool|null $value
279
+	 *
280
+	 * @param mixed  $value
281
+	 * @param string $message
282
+	 *
283
+	 * @throws InvalidArgumentException
284
+	 *
285
+	 * @return void
286
+	 */
287
+	public static function nullOrBoolean($value, $message = '')
288
+	{
289
+		static::__callStatic('nullOrBoolean', array($value, $message));
290
+	}
291
+
292
+	/**
293
+	 * @psalm-pure
294
+	 * @psalm-assert iterable<bool> $value
295
+	 *
296
+	 * @param mixed  $value
297
+	 * @param string $message
298
+	 *
299
+	 * @throws InvalidArgumentException
300
+	 *
301
+	 * @return void
302
+	 */
303
+	public static function allBoolean($value, $message = '')
304
+	{
305
+		static::__callStatic('allBoolean', array($value, $message));
306
+	}
307
+
308
+	/**
309
+	 * @psalm-pure
310
+	 * @psalm-assert scalar|null $value
311
+	 *
312
+	 * @param mixed  $value
313
+	 * @param string $message
314
+	 *
315
+	 * @throws InvalidArgumentException
316
+	 *
317
+	 * @return void
318
+	 */
319
+	public static function nullOrScalar($value, $message = '')
320
+	{
321
+		static::__callStatic('nullOrScalar', array($value, $message));
322
+	}
323
+
324
+	/**
325
+	 * @psalm-pure
326
+	 * @psalm-assert iterable<scalar> $value
327
+	 *
328
+	 * @param mixed  $value
329
+	 * @param string $message
330
+	 *
331
+	 * @throws InvalidArgumentException
332
+	 *
333
+	 * @return void
334
+	 */
335
+	public static function allScalar($value, $message = '')
336
+	{
337
+		static::__callStatic('allScalar', array($value, $message));
338
+	}
339
+
340
+	/**
341
+	 * @psalm-pure
342
+	 * @psalm-assert object|null $value
343
+	 *
344
+	 * @param mixed  $value
345
+	 * @param string $message
346
+	 *
347
+	 * @throws InvalidArgumentException
348
+	 *
349
+	 * @return void
350
+	 */
351
+	public static function nullOrObject($value, $message = '')
352
+	{
353
+		static::__callStatic('nullOrObject', array($value, $message));
354
+	}
355
+
356
+	/**
357
+	 * @psalm-pure
358
+	 * @psalm-assert iterable<object> $value
359
+	 *
360
+	 * @param mixed  $value
361
+	 * @param string $message
362
+	 *
363
+	 * @throws InvalidArgumentException
364
+	 *
365
+	 * @return void
366
+	 */
367
+	public static function allObject($value, $message = '')
368
+	{
369
+		static::__callStatic('allObject', array($value, $message));
370
+	}
371
+
372
+	/**
373
+	 * @psalm-pure
374
+	 * @psalm-assert resource|null $value
375
+	 *
376
+	 * @param mixed       $value
377
+	 * @param string|null $type    type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php
378
+	 * @param string      $message
379
+	 *
380
+	 * @throws InvalidArgumentException
381
+	 *
382
+	 * @return void
383
+	 */
384
+	public static function nullOrResource($value, $type = null, $message = '')
385
+	{
386
+		static::__callStatic('nullOrResource', array($value, $type, $message));
387
+	}
388
+
389
+	/**
390
+	 * @psalm-pure
391
+	 * @psalm-assert iterable<resource> $value
392
+	 *
393
+	 * @param mixed       $value
394
+	 * @param string|null $type    type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php
395
+	 * @param string      $message
396
+	 *
397
+	 * @throws InvalidArgumentException
398
+	 *
399
+	 * @return void
400
+	 */
401
+	public static function allResource($value, $type = null, $message = '')
402
+	{
403
+		static::__callStatic('allResource', array($value, $type, $message));
404
+	}
405
+
406
+	/**
407
+	 * @psalm-pure
408
+	 * @psalm-assert callable|null $value
409
+	 *
410
+	 * @param mixed  $value
411
+	 * @param string $message
412
+	 *
413
+	 * @throws InvalidArgumentException
414
+	 *
415
+	 * @return void
416
+	 */
417
+	public static function nullOrIsCallable($value, $message = '')
418
+	{
419
+		static::__callStatic('nullOrIsCallable', array($value, $message));
420
+	}
421
+
422
+	/**
423
+	 * @psalm-pure
424
+	 * @psalm-assert iterable<callable> $value
425
+	 *
426
+	 * @param mixed  $value
427
+	 * @param string $message
428
+	 *
429
+	 * @throws InvalidArgumentException
430
+	 *
431
+	 * @return void
432
+	 */
433
+	public static function allIsCallable($value, $message = '')
434
+	{
435
+		static::__callStatic('allIsCallable', array($value, $message));
436
+	}
437
+
438
+	/**
439
+	 * @psalm-pure
440
+	 * @psalm-assert array|null $value
441
+	 *
442
+	 * @param mixed  $value
443
+	 * @param string $message
444
+	 *
445
+	 * @throws InvalidArgumentException
446
+	 *
447
+	 * @return void
448
+	 */
449
+	public static function nullOrIsArray($value, $message = '')
450
+	{
451
+		static::__callStatic('nullOrIsArray', array($value, $message));
452
+	}
453
+
454
+	/**
455
+	 * @psalm-pure
456
+	 * @psalm-assert iterable<array> $value
457
+	 *
458
+	 * @param mixed  $value
459
+	 * @param string $message
460
+	 *
461
+	 * @throws InvalidArgumentException
462
+	 *
463
+	 * @return void
464
+	 */
465
+	public static function allIsArray($value, $message = '')
466
+	{
467
+		static::__callStatic('allIsArray', array($value, $message));
468
+	}
469
+
470
+	/**
471
+	 * @psalm-pure
472
+	 * @psalm-assert iterable|null $value
473
+	 *
474
+	 * @deprecated use "isIterable" or "isInstanceOf" instead
475
+	 *
476
+	 * @param mixed  $value
477
+	 * @param string $message
478
+	 *
479
+	 * @throws InvalidArgumentException
480
+	 *
481
+	 * @return void
482
+	 */
483
+	public static function nullOrIsTraversable($value, $message = '')
484
+	{
485
+		static::__callStatic('nullOrIsTraversable', array($value, $message));
486
+	}
487
+
488
+	/**
489
+	 * @psalm-pure
490
+	 * @psalm-assert iterable<iterable> $value
491
+	 *
492
+	 * @deprecated use "isIterable" or "isInstanceOf" instead
493
+	 *
494
+	 * @param mixed  $value
495
+	 * @param string $message
496
+	 *
497
+	 * @throws InvalidArgumentException
498
+	 *
499
+	 * @return void
500
+	 */
501
+	public static function allIsTraversable($value, $message = '')
502
+	{
503
+		static::__callStatic('allIsTraversable', array($value, $message));
504
+	}
505
+
506
+	/**
507
+	 * @psalm-pure
508
+	 * @psalm-assert array|ArrayAccess|null $value
509
+	 *
510
+	 * @param mixed  $value
511
+	 * @param string $message
512
+	 *
513
+	 * @throws InvalidArgumentException
514
+	 *
515
+	 * @return void
516
+	 */
517
+	public static function nullOrIsArrayAccessible($value, $message = '')
518
+	{
519
+		static::__callStatic('nullOrIsArrayAccessible', array($value, $message));
520
+	}
521
+
522
+	/**
523
+	 * @psalm-pure
524
+	 * @psalm-assert iterable<array|ArrayAccess> $value
525
+	 *
526
+	 * @param mixed  $value
527
+	 * @param string $message
528
+	 *
529
+	 * @throws InvalidArgumentException
530
+	 *
531
+	 * @return void
532
+	 */
533
+	public static function allIsArrayAccessible($value, $message = '')
534
+	{
535
+		static::__callStatic('allIsArrayAccessible', array($value, $message));
536
+	}
537
+
538
+	/**
539
+	 * @psalm-pure
540
+	 * @psalm-assert countable|null $value
541
+	 *
542
+	 * @param mixed  $value
543
+	 * @param string $message
544
+	 *
545
+	 * @throws InvalidArgumentException
546
+	 *
547
+	 * @return void
548
+	 */
549
+	public static function nullOrIsCountable($value, $message = '')
550
+	{
551
+		static::__callStatic('nullOrIsCountable', array($value, $message));
552
+	}
553
+
554
+	/**
555
+	 * @psalm-pure
556
+	 * @psalm-assert iterable<countable> $value
557
+	 *
558
+	 * @param mixed  $value
559
+	 * @param string $message
560
+	 *
561
+	 * @throws InvalidArgumentException
562
+	 *
563
+	 * @return void
564
+	 */
565
+	public static function allIsCountable($value, $message = '')
566
+	{
567
+		static::__callStatic('allIsCountable', array($value, $message));
568
+	}
569
+
570
+	/**
571
+	 * @psalm-pure
572
+	 * @psalm-assert iterable|null $value
573
+	 *
574
+	 * @param mixed  $value
575
+	 * @param string $message
576
+	 *
577
+	 * @throws InvalidArgumentException
578
+	 *
579
+	 * @return void
580
+	 */
581
+	public static function nullOrIsIterable($value, $message = '')
582
+	{
583
+		static::__callStatic('nullOrIsIterable', array($value, $message));
584
+	}
585
+
586
+	/**
587
+	 * @psalm-pure
588
+	 * @psalm-assert iterable<iterable> $value
589
+	 *
590
+	 * @param mixed  $value
591
+	 * @param string $message
592
+	 *
593
+	 * @throws InvalidArgumentException
594
+	 *
595
+	 * @return void
596
+	 */
597
+	public static function allIsIterable($value, $message = '')
598
+	{
599
+		static::__callStatic('allIsIterable', array($value, $message));
600
+	}
601
+
602
+	/**
603
+	 * @psalm-pure
604
+	 * @psalm-template ExpectedType of object
605
+	 * @psalm-param class-string<ExpectedType> $class
606
+	 * @psalm-assert ExpectedType|null $value
607
+	 *
608
+	 * @param mixed         $value
609
+	 * @param string|object $class
610
+	 * @param string        $message
611
+	 *
612
+	 * @throws InvalidArgumentException
613
+	 *
614
+	 * @return void
615
+	 */
616
+	public static function nullOrIsInstanceOf($value, $class, $message = '')
617
+	{
618
+		static::__callStatic('nullOrIsInstanceOf', array($value, $class, $message));
619
+	}
620
+
621
+	/**
622
+	 * @psalm-pure
623
+	 * @psalm-template ExpectedType of object
624
+	 * @psalm-param class-string<ExpectedType> $class
625
+	 * @psalm-assert iterable<ExpectedType> $value
626
+	 *
627
+	 * @param mixed         $value
628
+	 * @param string|object $class
629
+	 * @param string        $message
630
+	 *
631
+	 * @throws InvalidArgumentException
632
+	 *
633
+	 * @return void
634
+	 */
635
+	public static function allIsInstanceOf($value, $class, $message = '')
636
+	{
637
+		static::__callStatic('allIsInstanceOf', array($value, $class, $message));
638
+	}
639
+
640
+	/**
641
+	 * @psalm-pure
642
+	 * @psalm-template ExpectedType of object
643
+	 * @psalm-param class-string<ExpectedType> $class
644
+	 *
645
+	 * @param mixed         $value
646
+	 * @param string|object $class
647
+	 * @param string        $message
648
+	 *
649
+	 * @throws InvalidArgumentException
650
+	 *
651
+	 * @return void
652
+	 */
653
+	public static function nullOrNotInstanceOf($value, $class, $message = '')
654
+	{
655
+		static::__callStatic('nullOrNotInstanceOf', array($value, $class, $message));
656
+	}
657
+
658
+	/**
659
+	 * @psalm-pure
660
+	 * @psalm-template ExpectedType of object
661
+	 * @psalm-param class-string<ExpectedType> $class
662
+	 *
663
+	 * @param mixed         $value
664
+	 * @param string|object $class
665
+	 * @param string        $message
666
+	 *
667
+	 * @throws InvalidArgumentException
668
+	 *
669
+	 * @return void
670
+	 */
671
+	public static function allNotInstanceOf($value, $class, $message = '')
672
+	{
673
+		static::__callStatic('allNotInstanceOf', array($value, $class, $message));
674
+	}
675
+
676
+	/**
677
+	 * @psalm-pure
678
+	 * @psalm-param array<class-string> $classes
679
+	 *
680
+	 * @param mixed                $value
681
+	 * @param array<object|string> $classes
682
+	 * @param string               $message
683
+	 *
684
+	 * @throws InvalidArgumentException
685
+	 *
686
+	 * @return void
687
+	 */
688
+	public static function nullOrIsInstanceOfAny($value, $classes, $message = '')
689
+	{
690
+		static::__callStatic('nullOrIsInstanceOfAny', array($value, $classes, $message));
691
+	}
692
+
693
+	/**
694
+	 * @psalm-pure
695
+	 * @psalm-param array<class-string> $classes
696
+	 *
697
+	 * @param mixed                $value
698
+	 * @param array<object|string> $classes
699
+	 * @param string               $message
700
+	 *
701
+	 * @throws InvalidArgumentException
702
+	 *
703
+	 * @return void
704
+	 */
705
+	public static function allIsInstanceOfAny($value, $classes, $message = '')
706
+	{
707
+		static::__callStatic('allIsInstanceOfAny', array($value, $classes, $message));
708
+	}
709
+
710
+	/**
711
+	 * @psalm-pure
712
+	 * @psalm-template ExpectedType of object
713
+	 * @psalm-param class-string<ExpectedType> $class
714
+	 * @psalm-assert ExpectedType|class-string<ExpectedType>|null $value
715
+	 *
716
+	 * @param object|string|null $value
717
+	 * @param string             $class
718
+	 * @param string             $message
719
+	 *
720
+	 * @throws InvalidArgumentException
721
+	 *
722
+	 * @return void
723
+	 */
724
+	public static function nullOrIsAOf($value, $class, $message = '')
725
+	{
726
+		static::__callStatic('nullOrIsAOf', array($value, $class, $message));
727
+	}
728
+
729
+	/**
730
+	 * @psalm-pure
731
+	 * @psalm-template ExpectedType of object
732
+	 * @psalm-param class-string<ExpectedType> $class
733
+	 * @psalm-assert iterable<ExpectedType|class-string<ExpectedType>> $value
734
+	 *
735
+	 * @param iterable<object|string> $value
736
+	 * @param string                  $class
737
+	 * @param string                  $message
738
+	 *
739
+	 * @throws InvalidArgumentException
740
+	 *
741
+	 * @return void
742
+	 */
743
+	public static function allIsAOf($value, $class, $message = '')
744
+	{
745
+		static::__callStatic('allIsAOf', array($value, $class, $message));
746
+	}
747
+
748
+	/**
749
+	 * @psalm-pure
750
+	 * @psalm-template UnexpectedType of object
751
+	 * @psalm-param class-string<UnexpectedType> $class
752
+	 *
753
+	 * @param object|string|null $value
754
+	 * @param string             $class
755
+	 * @param string             $message
756
+	 *
757
+	 * @throws InvalidArgumentException
758
+	 *
759
+	 * @return void
760
+	 */
761
+	public static function nullOrIsNotA($value, $class, $message = '')
762
+	{
763
+		static::__callStatic('nullOrIsNotA', array($value, $class, $message));
764
+	}
765
+
766
+	/**
767
+	 * @psalm-pure
768
+	 * @psalm-template UnexpectedType of object
769
+	 * @psalm-param class-string<UnexpectedType> $class
770
+	 *
771
+	 * @param iterable<object|string> $value
772
+	 * @param string                  $class
773
+	 * @param string                  $message
774
+	 *
775
+	 * @throws InvalidArgumentException
776
+	 *
777
+	 * @return void
778
+	 */
779
+	public static function allIsNotA($value, $class, $message = '')
780
+	{
781
+		static::__callStatic('allIsNotA', array($value, $class, $message));
782
+	}
783
+
784
+	/**
785
+	 * @psalm-pure
786
+	 * @psalm-param array<class-string> $classes
787
+	 *
788
+	 * @param object|string|null $value
789
+	 * @param string[]           $classes
790
+	 * @param string             $message
791
+	 *
792
+	 * @throws InvalidArgumentException
793
+	 *
794
+	 * @return void
795
+	 */
796
+	public static function nullOrIsAnyOf($value, $classes, $message = '')
797
+	{
798
+		static::__callStatic('nullOrIsAnyOf', array($value, $classes, $message));
799
+	}
800
+
801
+	/**
802
+	 * @psalm-pure
803
+	 * @psalm-param array<class-string> $classes
804
+	 *
805
+	 * @param iterable<object|string> $value
806
+	 * @param string[]                $classes
807
+	 * @param string                  $message
808
+	 *
809
+	 * @throws InvalidArgumentException
810
+	 *
811
+	 * @return void
812
+	 */
813
+	public static function allIsAnyOf($value, $classes, $message = '')
814
+	{
815
+		static::__callStatic('allIsAnyOf', array($value, $classes, $message));
816
+	}
817
+
818
+	/**
819
+	 * @psalm-pure
820
+	 * @psalm-assert empty $value
821
+	 *
822
+	 * @param mixed  $value
823
+	 * @param string $message
824
+	 *
825
+	 * @throws InvalidArgumentException
826
+	 *
827
+	 * @return void
828
+	 */
829
+	public static function nullOrIsEmpty($value, $message = '')
830
+	{
831
+		static::__callStatic('nullOrIsEmpty', array($value, $message));
832
+	}
833
+
834
+	/**
835
+	 * @psalm-pure
836
+	 * @psalm-assert iterable<empty> $value
837
+	 *
838
+	 * @param mixed  $value
839
+	 * @param string $message
840
+	 *
841
+	 * @throws InvalidArgumentException
842
+	 *
843
+	 * @return void
844
+	 */
845
+	public static function allIsEmpty($value, $message = '')
846
+	{
847
+		static::__callStatic('allIsEmpty', array($value, $message));
848
+	}
849
+
850
+	/**
851
+	 * @psalm-pure
852
+	 *
853
+	 * @param mixed  $value
854
+	 * @param string $message
855
+	 *
856
+	 * @throws InvalidArgumentException
857
+	 *
858
+	 * @return void
859
+	 */
860
+	public static function nullOrNotEmpty($value, $message = '')
861
+	{
862
+		static::__callStatic('nullOrNotEmpty', array($value, $message));
863
+	}
864
+
865
+	/**
866
+	 * @psalm-pure
867
+	 *
868
+	 * @param mixed  $value
869
+	 * @param string $message
870
+	 *
871
+	 * @throws InvalidArgumentException
872
+	 *
873
+	 * @return void
874
+	 */
875
+	public static function allNotEmpty($value, $message = '')
876
+	{
877
+		static::__callStatic('allNotEmpty', array($value, $message));
878
+	}
879
+
880
+	/**
881
+	 * @psalm-pure
882
+	 * @psalm-assert iterable<null> $value
883
+	 *
884
+	 * @param mixed  $value
885
+	 * @param string $message
886
+	 *
887
+	 * @throws InvalidArgumentException
888
+	 *
889
+	 * @return void
890
+	 */
891
+	public static function allNull($value, $message = '')
892
+	{
893
+		static::__callStatic('allNull', array($value, $message));
894
+	}
895
+
896
+	/**
897
+	 * @psalm-pure
898
+	 *
899
+	 * @param mixed  $value
900
+	 * @param string $message
901
+	 *
902
+	 * @throws InvalidArgumentException
903
+	 *
904
+	 * @return void
905
+	 */
906
+	public static function allNotNull($value, $message = '')
907
+	{
908
+		static::__callStatic('allNotNull', array($value, $message));
909
+	}
910
+
911
+	/**
912
+	 * @psalm-pure
913
+	 * @psalm-assert true|null $value
914
+	 *
915
+	 * @param mixed  $value
916
+	 * @param string $message
917
+	 *
918
+	 * @throws InvalidArgumentException
919
+	 *
920
+	 * @return void
921
+	 */
922
+	public static function nullOrTrue($value, $message = '')
923
+	{
924
+		static::__callStatic('nullOrTrue', array($value, $message));
925
+	}
926
+
927
+	/**
928
+	 * @psalm-pure
929
+	 * @psalm-assert iterable<true> $value
930
+	 *
931
+	 * @param mixed  $value
932
+	 * @param string $message
933
+	 *
934
+	 * @throws InvalidArgumentException
935
+	 *
936
+	 * @return void
937
+	 */
938
+	public static function allTrue($value, $message = '')
939
+	{
940
+		static::__callStatic('allTrue', array($value, $message));
941
+	}
942
+
943
+	/**
944
+	 * @psalm-pure
945
+	 * @psalm-assert false|null $value
946
+	 *
947
+	 * @param mixed  $value
948
+	 * @param string $message
949
+	 *
950
+	 * @throws InvalidArgumentException
951
+	 *
952
+	 * @return void
953
+	 */
954
+	public static function nullOrFalse($value, $message = '')
955
+	{
956
+		static::__callStatic('nullOrFalse', array($value, $message));
957
+	}
958
+
959
+	/**
960
+	 * @psalm-pure
961
+	 * @psalm-assert iterable<false> $value
962
+	 *
963
+	 * @param mixed  $value
964
+	 * @param string $message
965
+	 *
966
+	 * @throws InvalidArgumentException
967
+	 *
968
+	 * @return void
969
+	 */
970
+	public static function allFalse($value, $message = '')
971
+	{
972
+		static::__callStatic('allFalse', array($value, $message));
973
+	}
974
+
975
+	/**
976
+	 * @psalm-pure
977
+	 *
978
+	 * @param mixed  $value
979
+	 * @param string $message
980
+	 *
981
+	 * @throws InvalidArgumentException
982
+	 *
983
+	 * @return void
984
+	 */
985
+	public static function nullOrNotFalse($value, $message = '')
986
+	{
987
+		static::__callStatic('nullOrNotFalse', array($value, $message));
988
+	}
989
+
990
+	/**
991
+	 * @psalm-pure
992
+	 *
993
+	 * @param mixed  $value
994
+	 * @param string $message
995
+	 *
996
+	 * @throws InvalidArgumentException
997
+	 *
998
+	 * @return void
999
+	 */
1000
+	public static function allNotFalse($value, $message = '')
1001
+	{
1002
+		static::__callStatic('allNotFalse', array($value, $message));
1003
+	}
1004
+
1005
+	/**
1006
+	 * @param mixed  $value
1007
+	 * @param string $message
1008
+	 *
1009
+	 * @throws InvalidArgumentException
1010
+	 *
1011
+	 * @return void
1012
+	 */
1013
+	public static function nullOrIp($value, $message = '')
1014
+	{
1015
+		static::__callStatic('nullOrIp', array($value, $message));
1016
+	}
1017
+
1018
+	/**
1019
+	 * @param mixed  $value
1020
+	 * @param string $message
1021
+	 *
1022
+	 * @throws InvalidArgumentException
1023
+	 *
1024
+	 * @return void
1025
+	 */
1026
+	public static function allIp($value, $message = '')
1027
+	{
1028
+		static::__callStatic('allIp', array($value, $message));
1029
+	}
1030
+
1031
+	/**
1032
+	 * @param mixed  $value
1033
+	 * @param string $message
1034
+	 *
1035
+	 * @throws InvalidArgumentException
1036
+	 *
1037
+	 * @return void
1038
+	 */
1039
+	public static function nullOrIpv4($value, $message = '')
1040
+	{
1041
+		static::__callStatic('nullOrIpv4', array($value, $message));
1042
+	}
1043
+
1044
+	/**
1045
+	 * @param mixed  $value
1046
+	 * @param string $message
1047
+	 *
1048
+	 * @throws InvalidArgumentException
1049
+	 *
1050
+	 * @return void
1051
+	 */
1052
+	public static function allIpv4($value, $message = '')
1053
+	{
1054
+		static::__callStatic('allIpv4', array($value, $message));
1055
+	}
1056
+
1057
+	/**
1058
+	 * @param mixed  $value
1059
+	 * @param string $message
1060
+	 *
1061
+	 * @throws InvalidArgumentException
1062
+	 *
1063
+	 * @return void
1064
+	 */
1065
+	public static function nullOrIpv6($value, $message = '')
1066
+	{
1067
+		static::__callStatic('nullOrIpv6', array($value, $message));
1068
+	}
1069
+
1070
+	/**
1071
+	 * @param mixed  $value
1072
+	 * @param string $message
1073
+	 *
1074
+	 * @throws InvalidArgumentException
1075
+	 *
1076
+	 * @return void
1077
+	 */
1078
+	public static function allIpv6($value, $message = '')
1079
+	{
1080
+		static::__callStatic('allIpv6', array($value, $message));
1081
+	}
1082
+
1083
+	/**
1084
+	 * @param mixed  $value
1085
+	 * @param string $message
1086
+	 *
1087
+	 * @throws InvalidArgumentException
1088
+	 *
1089
+	 * @return void
1090
+	 */
1091
+	public static function nullOrEmail($value, $message = '')
1092
+	{
1093
+		static::__callStatic('nullOrEmail', array($value, $message));
1094
+	}
1095
+
1096
+	/**
1097
+	 * @param mixed  $value
1098
+	 * @param string $message
1099
+	 *
1100
+	 * @throws InvalidArgumentException
1101
+	 *
1102
+	 * @return void
1103
+	 */
1104
+	public static function allEmail($value, $message = '')
1105
+	{
1106
+		static::__callStatic('allEmail', array($value, $message));
1107
+	}
1108
+
1109
+	/**
1110
+	 * @param array|null $values
1111
+	 * @param string     $message
1112
+	 *
1113
+	 * @throws InvalidArgumentException
1114
+	 *
1115
+	 * @return void
1116
+	 */
1117
+	public static function nullOrUniqueValues($values, $message = '')
1118
+	{
1119
+		static::__callStatic('nullOrUniqueValues', array($values, $message));
1120
+	}
1121
+
1122
+	/**
1123
+	 * @param iterable<array> $values
1124
+	 * @param string          $message
1125
+	 *
1126
+	 * @throws InvalidArgumentException
1127
+	 *
1128
+	 * @return void
1129
+	 */
1130
+	public static function allUniqueValues($values, $message = '')
1131
+	{
1132
+		static::__callStatic('allUniqueValues', array($values, $message));
1133
+	}
1134
+
1135
+	/**
1136
+	 * @param mixed  $value
1137
+	 * @param mixed  $expect
1138
+	 * @param string $message
1139
+	 *
1140
+	 * @throws InvalidArgumentException
1141
+	 *
1142
+	 * @return void
1143
+	 */
1144
+	public static function nullOrEq($value, $expect, $message = '')
1145
+	{
1146
+		static::__callStatic('nullOrEq', array($value, $expect, $message));
1147
+	}
1148
+
1149
+	/**
1150
+	 * @param mixed  $value
1151
+	 * @param mixed  $expect
1152
+	 * @param string $message
1153
+	 *
1154
+	 * @throws InvalidArgumentException
1155
+	 *
1156
+	 * @return void
1157
+	 */
1158
+	public static function allEq($value, $expect, $message = '')
1159
+	{
1160
+		static::__callStatic('allEq', array($value, $expect, $message));
1161
+	}
1162
+
1163
+	/**
1164
+	 * @param mixed  $value
1165
+	 * @param mixed  $expect
1166
+	 * @param string $message
1167
+	 *
1168
+	 * @throws InvalidArgumentException
1169
+	 *
1170
+	 * @return void
1171
+	 */
1172
+	public static function nullOrNotEq($value, $expect, $message = '')
1173
+	{
1174
+		static::__callStatic('nullOrNotEq', array($value, $expect, $message));
1175
+	}
1176
+
1177
+	/**
1178
+	 * @param mixed  $value
1179
+	 * @param mixed  $expect
1180
+	 * @param string $message
1181
+	 *
1182
+	 * @throws InvalidArgumentException
1183
+	 *
1184
+	 * @return void
1185
+	 */
1186
+	public static function allNotEq($value, $expect, $message = '')
1187
+	{
1188
+		static::__callStatic('allNotEq', array($value, $expect, $message));
1189
+	}
1190
+
1191
+	/**
1192
+	 * @psalm-pure
1193
+	 *
1194
+	 * @param mixed  $value
1195
+	 * @param mixed  $expect
1196
+	 * @param string $message
1197
+	 *
1198
+	 * @throws InvalidArgumentException
1199
+	 *
1200
+	 * @return void
1201
+	 */
1202
+	public static function nullOrSame($value, $expect, $message = '')
1203
+	{
1204
+		static::__callStatic('nullOrSame', array($value, $expect, $message));
1205
+	}
1206
+
1207
+	/**
1208
+	 * @psalm-pure
1209
+	 *
1210
+	 * @param mixed  $value
1211
+	 * @param mixed  $expect
1212
+	 * @param string $message
1213
+	 *
1214
+	 * @throws InvalidArgumentException
1215
+	 *
1216
+	 * @return void
1217
+	 */
1218
+	public static function allSame($value, $expect, $message = '')
1219
+	{
1220
+		static::__callStatic('allSame', array($value, $expect, $message));
1221
+	}
1222
+
1223
+	/**
1224
+	 * @psalm-pure
1225
+	 *
1226
+	 * @param mixed  $value
1227
+	 * @param mixed  $expect
1228
+	 * @param string $message
1229
+	 *
1230
+	 * @throws InvalidArgumentException
1231
+	 *
1232
+	 * @return void
1233
+	 */
1234
+	public static function nullOrNotSame($value, $expect, $message = '')
1235
+	{
1236
+		static::__callStatic('nullOrNotSame', array($value, $expect, $message));
1237
+	}
1238
+
1239
+	/**
1240
+	 * @psalm-pure
1241
+	 *
1242
+	 * @param mixed  $value
1243
+	 * @param mixed  $expect
1244
+	 * @param string $message
1245
+	 *
1246
+	 * @throws InvalidArgumentException
1247
+	 *
1248
+	 * @return void
1249
+	 */
1250
+	public static function allNotSame($value, $expect, $message = '')
1251
+	{
1252
+		static::__callStatic('allNotSame', array($value, $expect, $message));
1253
+	}
1254
+
1255
+	/**
1256
+	 * @psalm-pure
1257
+	 *
1258
+	 * @param mixed  $value
1259
+	 * @param mixed  $limit
1260
+	 * @param string $message
1261
+	 *
1262
+	 * @throws InvalidArgumentException
1263
+	 *
1264
+	 * @return void
1265
+	 */
1266
+	public static function nullOrGreaterThan($value, $limit, $message = '')
1267
+	{
1268
+		static::__callStatic('nullOrGreaterThan', array($value, $limit, $message));
1269
+	}
1270
+
1271
+	/**
1272
+	 * @psalm-pure
1273
+	 *
1274
+	 * @param mixed  $value
1275
+	 * @param mixed  $limit
1276
+	 * @param string $message
1277
+	 *
1278
+	 * @throws InvalidArgumentException
1279
+	 *
1280
+	 * @return void
1281
+	 */
1282
+	public static function allGreaterThan($value, $limit, $message = '')
1283
+	{
1284
+		static::__callStatic('allGreaterThan', array($value, $limit, $message));
1285
+	}
1286
+
1287
+	/**
1288
+	 * @psalm-pure
1289
+	 *
1290
+	 * @param mixed  $value
1291
+	 * @param mixed  $limit
1292
+	 * @param string $message
1293
+	 *
1294
+	 * @throws InvalidArgumentException
1295
+	 *
1296
+	 * @return void
1297
+	 */
1298
+	public static function nullOrGreaterThanEq($value, $limit, $message = '')
1299
+	{
1300
+		static::__callStatic('nullOrGreaterThanEq', array($value, $limit, $message));
1301
+	}
1302
+
1303
+	/**
1304
+	 * @psalm-pure
1305
+	 *
1306
+	 * @param mixed  $value
1307
+	 * @param mixed  $limit
1308
+	 * @param string $message
1309
+	 *
1310
+	 * @throws InvalidArgumentException
1311
+	 *
1312
+	 * @return void
1313
+	 */
1314
+	public static function allGreaterThanEq($value, $limit, $message = '')
1315
+	{
1316
+		static::__callStatic('allGreaterThanEq', array($value, $limit, $message));
1317
+	}
1318
+
1319
+	/**
1320
+	 * @psalm-pure
1321
+	 *
1322
+	 * @param mixed  $value
1323
+	 * @param mixed  $limit
1324
+	 * @param string $message
1325
+	 *
1326
+	 * @throws InvalidArgumentException
1327
+	 *
1328
+	 * @return void
1329
+	 */
1330
+	public static function nullOrLessThan($value, $limit, $message = '')
1331
+	{
1332
+		static::__callStatic('nullOrLessThan', array($value, $limit, $message));
1333
+	}
1334
+
1335
+	/**
1336
+	 * @psalm-pure
1337
+	 *
1338
+	 * @param mixed  $value
1339
+	 * @param mixed  $limit
1340
+	 * @param string $message
1341
+	 *
1342
+	 * @throws InvalidArgumentException
1343
+	 *
1344
+	 * @return void
1345
+	 */
1346
+	public static function allLessThan($value, $limit, $message = '')
1347
+	{
1348
+		static::__callStatic('allLessThan', array($value, $limit, $message));
1349
+	}
1350
+
1351
+	/**
1352
+	 * @psalm-pure
1353
+	 *
1354
+	 * @param mixed  $value
1355
+	 * @param mixed  $limit
1356
+	 * @param string $message
1357
+	 *
1358
+	 * @throws InvalidArgumentException
1359
+	 *
1360
+	 * @return void
1361
+	 */
1362
+	public static function nullOrLessThanEq($value, $limit, $message = '')
1363
+	{
1364
+		static::__callStatic('nullOrLessThanEq', array($value, $limit, $message));
1365
+	}
1366
+
1367
+	/**
1368
+	 * @psalm-pure
1369
+	 *
1370
+	 * @param mixed  $value
1371
+	 * @param mixed  $limit
1372
+	 * @param string $message
1373
+	 *
1374
+	 * @throws InvalidArgumentException
1375
+	 *
1376
+	 * @return void
1377
+	 */
1378
+	public static function allLessThanEq($value, $limit, $message = '')
1379
+	{
1380
+		static::__callStatic('allLessThanEq', array($value, $limit, $message));
1381
+	}
1382
+
1383
+	/**
1384
+	 * @psalm-pure
1385
+	 *
1386
+	 * @param mixed  $value
1387
+	 * @param mixed  $min
1388
+	 * @param mixed  $max
1389
+	 * @param string $message
1390
+	 *
1391
+	 * @throws InvalidArgumentException
1392
+	 *
1393
+	 * @return void
1394
+	 */
1395
+	public static function nullOrRange($value, $min, $max, $message = '')
1396
+	{
1397
+		static::__callStatic('nullOrRange', array($value, $min, $max, $message));
1398
+	}
1399
+
1400
+	/**
1401
+	 * @psalm-pure
1402
+	 *
1403
+	 * @param mixed  $value
1404
+	 * @param mixed  $min
1405
+	 * @param mixed  $max
1406
+	 * @param string $message
1407
+	 *
1408
+	 * @throws InvalidArgumentException
1409
+	 *
1410
+	 * @return void
1411
+	 */
1412
+	public static function allRange($value, $min, $max, $message = '')
1413
+	{
1414
+		static::__callStatic('allRange', array($value, $min, $max, $message));
1415
+	}
1416
+
1417
+	/**
1418
+	 * @psalm-pure
1419
+	 *
1420
+	 * @param mixed  $value
1421
+	 * @param array  $values
1422
+	 * @param string $message
1423
+	 *
1424
+	 * @throws InvalidArgumentException
1425
+	 *
1426
+	 * @return void
1427
+	 */
1428
+	public static function nullOrOneOf($value, $values, $message = '')
1429
+	{
1430
+		static::__callStatic('nullOrOneOf', array($value, $values, $message));
1431
+	}
1432
+
1433
+	/**
1434
+	 * @psalm-pure
1435
+	 *
1436
+	 * @param mixed  $value
1437
+	 * @param array  $values
1438
+	 * @param string $message
1439
+	 *
1440
+	 * @throws InvalidArgumentException
1441
+	 *
1442
+	 * @return void
1443
+	 */
1444
+	public static function allOneOf($value, $values, $message = '')
1445
+	{
1446
+		static::__callStatic('allOneOf', array($value, $values, $message));
1447
+	}
1448
+
1449
+	/**
1450
+	 * @psalm-pure
1451
+	 *
1452
+	 * @param mixed  $value
1453
+	 * @param array  $values
1454
+	 * @param string $message
1455
+	 *
1456
+	 * @throws InvalidArgumentException
1457
+	 *
1458
+	 * @return void
1459
+	 */
1460
+	public static function nullOrInArray($value, $values, $message = '')
1461
+	{
1462
+		static::__callStatic('nullOrInArray', array($value, $values, $message));
1463
+	}
1464
+
1465
+	/**
1466
+	 * @psalm-pure
1467
+	 *
1468
+	 * @param mixed  $value
1469
+	 * @param array  $values
1470
+	 * @param string $message
1471
+	 *
1472
+	 * @throws InvalidArgumentException
1473
+	 *
1474
+	 * @return void
1475
+	 */
1476
+	public static function allInArray($value, $values, $message = '')
1477
+	{
1478
+		static::__callStatic('allInArray', array($value, $values, $message));
1479
+	}
1480
+
1481
+	/**
1482
+	 * @psalm-pure
1483
+	 *
1484
+	 * @param string|null $value
1485
+	 * @param string      $subString
1486
+	 * @param string      $message
1487
+	 *
1488
+	 * @throws InvalidArgumentException
1489
+	 *
1490
+	 * @return void
1491
+	 */
1492
+	public static function nullOrContains($value, $subString, $message = '')
1493
+	{
1494
+		static::__callStatic('nullOrContains', array($value, $subString, $message));
1495
+	}
1496
+
1497
+	/**
1498
+	 * @psalm-pure
1499
+	 *
1500
+	 * @param iterable<string> $value
1501
+	 * @param string           $subString
1502
+	 * @param string           $message
1503
+	 *
1504
+	 * @throws InvalidArgumentException
1505
+	 *
1506
+	 * @return void
1507
+	 */
1508
+	public static function allContains($value, $subString, $message = '')
1509
+	{
1510
+		static::__callStatic('allContains', array($value, $subString, $message));
1511
+	}
1512
+
1513
+	/**
1514
+	 * @psalm-pure
1515
+	 *
1516
+	 * @param string|null $value
1517
+	 * @param string      $subString
1518
+	 * @param string      $message
1519
+	 *
1520
+	 * @throws InvalidArgumentException
1521
+	 *
1522
+	 * @return void
1523
+	 */
1524
+	public static function nullOrNotContains($value, $subString, $message = '')
1525
+	{
1526
+		static::__callStatic('nullOrNotContains', array($value, $subString, $message));
1527
+	}
1528
+
1529
+	/**
1530
+	 * @psalm-pure
1531
+	 *
1532
+	 * @param iterable<string> $value
1533
+	 * @param string           $subString
1534
+	 * @param string           $message
1535
+	 *
1536
+	 * @throws InvalidArgumentException
1537
+	 *
1538
+	 * @return void
1539
+	 */
1540
+	public static function allNotContains($value, $subString, $message = '')
1541
+	{
1542
+		static::__callStatic('allNotContains', array($value, $subString, $message));
1543
+	}
1544
+
1545
+	/**
1546
+	 * @psalm-pure
1547
+	 *
1548
+	 * @param string|null $value
1549
+	 * @param string      $message
1550
+	 *
1551
+	 * @throws InvalidArgumentException
1552
+	 *
1553
+	 * @return void
1554
+	 */
1555
+	public static function nullOrNotWhitespaceOnly($value, $message = '')
1556
+	{
1557
+		static::__callStatic('nullOrNotWhitespaceOnly', array($value, $message));
1558
+	}
1559
+
1560
+	/**
1561
+	 * @psalm-pure
1562
+	 *
1563
+	 * @param iterable<string> $value
1564
+	 * @param string           $message
1565
+	 *
1566
+	 * @throws InvalidArgumentException
1567
+	 *
1568
+	 * @return void
1569
+	 */
1570
+	public static function allNotWhitespaceOnly($value, $message = '')
1571
+	{
1572
+		static::__callStatic('allNotWhitespaceOnly', array($value, $message));
1573
+	}
1574
+
1575
+	/**
1576
+	 * @psalm-pure
1577
+	 *
1578
+	 * @param string|null $value
1579
+	 * @param string      $prefix
1580
+	 * @param string      $message
1581
+	 *
1582
+	 * @throws InvalidArgumentException
1583
+	 *
1584
+	 * @return void
1585
+	 */
1586
+	public static function nullOrStartsWith($value, $prefix, $message = '')
1587
+	{
1588
+		static::__callStatic('nullOrStartsWith', array($value, $prefix, $message));
1589
+	}
1590
+
1591
+	/**
1592
+	 * @psalm-pure
1593
+	 *
1594
+	 * @param iterable<string> $value
1595
+	 * @param string           $prefix
1596
+	 * @param string           $message
1597
+	 *
1598
+	 * @throws InvalidArgumentException
1599
+	 *
1600
+	 * @return void
1601
+	 */
1602
+	public static function allStartsWith($value, $prefix, $message = '')
1603
+	{
1604
+		static::__callStatic('allStartsWith', array($value, $prefix, $message));
1605
+	}
1606
+
1607
+	/**
1608
+	 * @psalm-pure
1609
+	 *
1610
+	 * @param string|null $value
1611
+	 * @param string      $prefix
1612
+	 * @param string      $message
1613
+	 *
1614
+	 * @throws InvalidArgumentException
1615
+	 *
1616
+	 * @return void
1617
+	 */
1618
+	public static function nullOrNotStartsWith($value, $prefix, $message = '')
1619
+	{
1620
+		static::__callStatic('nullOrNotStartsWith', array($value, $prefix, $message));
1621
+	}
1622
+
1623
+	/**
1624
+	 * @psalm-pure
1625
+	 *
1626
+	 * @param iterable<string> $value
1627
+	 * @param string           $prefix
1628
+	 * @param string           $message
1629
+	 *
1630
+	 * @throws InvalidArgumentException
1631
+	 *
1632
+	 * @return void
1633
+	 */
1634
+	public static function allNotStartsWith($value, $prefix, $message = '')
1635
+	{
1636
+		static::__callStatic('allNotStartsWith', array($value, $prefix, $message));
1637
+	}
1638
+
1639
+	/**
1640
+	 * @psalm-pure
1641
+	 *
1642
+	 * @param mixed  $value
1643
+	 * @param string $message
1644
+	 *
1645
+	 * @throws InvalidArgumentException
1646
+	 *
1647
+	 * @return void
1648
+	 */
1649
+	public static function nullOrStartsWithLetter($value, $message = '')
1650
+	{
1651
+		static::__callStatic('nullOrStartsWithLetter', array($value, $message));
1652
+	}
1653
+
1654
+	/**
1655
+	 * @psalm-pure
1656
+	 *
1657
+	 * @param mixed  $value
1658
+	 * @param string $message
1659
+	 *
1660
+	 * @throws InvalidArgumentException
1661
+	 *
1662
+	 * @return void
1663
+	 */
1664
+	public static function allStartsWithLetter($value, $message = '')
1665
+	{
1666
+		static::__callStatic('allStartsWithLetter', array($value, $message));
1667
+	}
1668
+
1669
+	/**
1670
+	 * @psalm-pure
1671
+	 *
1672
+	 * @param string|null $value
1673
+	 * @param string      $suffix
1674
+	 * @param string      $message
1675
+	 *
1676
+	 * @throws InvalidArgumentException
1677
+	 *
1678
+	 * @return void
1679
+	 */
1680
+	public static function nullOrEndsWith($value, $suffix, $message = '')
1681
+	{
1682
+		static::__callStatic('nullOrEndsWith', array($value, $suffix, $message));
1683
+	}
1684
+
1685
+	/**
1686
+	 * @psalm-pure
1687
+	 *
1688
+	 * @param iterable<string> $value
1689
+	 * @param string           $suffix
1690
+	 * @param string           $message
1691
+	 *
1692
+	 * @throws InvalidArgumentException
1693
+	 *
1694
+	 * @return void
1695
+	 */
1696
+	public static function allEndsWith($value, $suffix, $message = '')
1697
+	{
1698
+		static::__callStatic('allEndsWith', array($value, $suffix, $message));
1699
+	}
1700
+
1701
+	/**
1702
+	 * @psalm-pure
1703
+	 *
1704
+	 * @param string|null $value
1705
+	 * @param string      $suffix
1706
+	 * @param string      $message
1707
+	 *
1708
+	 * @throws InvalidArgumentException
1709
+	 *
1710
+	 * @return void
1711
+	 */
1712
+	public static function nullOrNotEndsWith($value, $suffix, $message = '')
1713
+	{
1714
+		static::__callStatic('nullOrNotEndsWith', array($value, $suffix, $message));
1715
+	}
1716
+
1717
+	/**
1718
+	 * @psalm-pure
1719
+	 *
1720
+	 * @param iterable<string> $value
1721
+	 * @param string           $suffix
1722
+	 * @param string           $message
1723
+	 *
1724
+	 * @throws InvalidArgumentException
1725
+	 *
1726
+	 * @return void
1727
+	 */
1728
+	public static function allNotEndsWith($value, $suffix, $message = '')
1729
+	{
1730
+		static::__callStatic('allNotEndsWith', array($value, $suffix, $message));
1731
+	}
1732
+
1733
+	/**
1734
+	 * @psalm-pure
1735
+	 *
1736
+	 * @param string|null $value
1737
+	 * @param string      $pattern
1738
+	 * @param string      $message
1739
+	 *
1740
+	 * @throws InvalidArgumentException
1741
+	 *
1742
+	 * @return void
1743
+	 */
1744
+	public static function nullOrRegex($value, $pattern, $message = '')
1745
+	{
1746
+		static::__callStatic('nullOrRegex', array($value, $pattern, $message));
1747
+	}
1748
+
1749
+	/**
1750
+	 * @psalm-pure
1751
+	 *
1752
+	 * @param iterable<string> $value
1753
+	 * @param string           $pattern
1754
+	 * @param string           $message
1755
+	 *
1756
+	 * @throws InvalidArgumentException
1757
+	 *
1758
+	 * @return void
1759
+	 */
1760
+	public static function allRegex($value, $pattern, $message = '')
1761
+	{
1762
+		static::__callStatic('allRegex', array($value, $pattern, $message));
1763
+	}
1764
+
1765
+	/**
1766
+	 * @psalm-pure
1767
+	 *
1768
+	 * @param string|null $value
1769
+	 * @param string      $pattern
1770
+	 * @param string      $message
1771
+	 *
1772
+	 * @throws InvalidArgumentException
1773
+	 *
1774
+	 * @return void
1775
+	 */
1776
+	public static function nullOrNotRegex($value, $pattern, $message = '')
1777
+	{
1778
+		static::__callStatic('nullOrNotRegex', array($value, $pattern, $message));
1779
+	}
1780
+
1781
+	/**
1782
+	 * @psalm-pure
1783
+	 *
1784
+	 * @param iterable<string> $value
1785
+	 * @param string           $pattern
1786
+	 * @param string           $message
1787
+	 *
1788
+	 * @throws InvalidArgumentException
1789
+	 *
1790
+	 * @return void
1791
+	 */
1792
+	public static function allNotRegex($value, $pattern, $message = '')
1793
+	{
1794
+		static::__callStatic('allNotRegex', array($value, $pattern, $message));
1795
+	}
1796
+
1797
+	/**
1798
+	 * @psalm-pure
1799
+	 *
1800
+	 * @param mixed  $value
1801
+	 * @param string $message
1802
+	 *
1803
+	 * @throws InvalidArgumentException
1804
+	 *
1805
+	 * @return void
1806
+	 */
1807
+	public static function nullOrUnicodeLetters($value, $message = '')
1808
+	{
1809
+		static::__callStatic('nullOrUnicodeLetters', array($value, $message));
1810
+	}
1811
+
1812
+	/**
1813
+	 * @psalm-pure
1814
+	 *
1815
+	 * @param mixed  $value
1816
+	 * @param string $message
1817
+	 *
1818
+	 * @throws InvalidArgumentException
1819
+	 *
1820
+	 * @return void
1821
+	 */
1822
+	public static function allUnicodeLetters($value, $message = '')
1823
+	{
1824
+		static::__callStatic('allUnicodeLetters', array($value, $message));
1825
+	}
1826
+
1827
+	/**
1828
+	 * @psalm-pure
1829
+	 *
1830
+	 * @param mixed  $value
1831
+	 * @param string $message
1832
+	 *
1833
+	 * @throws InvalidArgumentException
1834
+	 *
1835
+	 * @return void
1836
+	 */
1837
+	public static function nullOrAlpha($value, $message = '')
1838
+	{
1839
+		static::__callStatic('nullOrAlpha', array($value, $message));
1840
+	}
1841
+
1842
+	/**
1843
+	 * @psalm-pure
1844
+	 *
1845
+	 * @param mixed  $value
1846
+	 * @param string $message
1847
+	 *
1848
+	 * @throws InvalidArgumentException
1849
+	 *
1850
+	 * @return void
1851
+	 */
1852
+	public static function allAlpha($value, $message = '')
1853
+	{
1854
+		static::__callStatic('allAlpha', array($value, $message));
1855
+	}
1856
+
1857
+	/**
1858
+	 * @psalm-pure
1859
+	 *
1860
+	 * @param string|null $value
1861
+	 * @param string      $message
1862
+	 *
1863
+	 * @throws InvalidArgumentException
1864
+	 *
1865
+	 * @return void
1866
+	 */
1867
+	public static function nullOrDigits($value, $message = '')
1868
+	{
1869
+		static::__callStatic('nullOrDigits', array($value, $message));
1870
+	}
1871
+
1872
+	/**
1873
+	 * @psalm-pure
1874
+	 *
1875
+	 * @param iterable<string> $value
1876
+	 * @param string           $message
1877
+	 *
1878
+	 * @throws InvalidArgumentException
1879
+	 *
1880
+	 * @return void
1881
+	 */
1882
+	public static function allDigits($value, $message = '')
1883
+	{
1884
+		static::__callStatic('allDigits', array($value, $message));
1885
+	}
1886
+
1887
+	/**
1888
+	 * @psalm-pure
1889
+	 *
1890
+	 * @param string|null $value
1891
+	 * @param string      $message
1892
+	 *
1893
+	 * @throws InvalidArgumentException
1894
+	 *
1895
+	 * @return void
1896
+	 */
1897
+	public static function nullOrAlnum($value, $message = '')
1898
+	{
1899
+		static::__callStatic('nullOrAlnum', array($value, $message));
1900
+	}
1901
+
1902
+	/**
1903
+	 * @psalm-pure
1904
+	 *
1905
+	 * @param iterable<string> $value
1906
+	 * @param string           $message
1907
+	 *
1908
+	 * @throws InvalidArgumentException
1909
+	 *
1910
+	 * @return void
1911
+	 */
1912
+	public static function allAlnum($value, $message = '')
1913
+	{
1914
+		static::__callStatic('allAlnum', array($value, $message));
1915
+	}
1916
+
1917
+	/**
1918
+	 * @psalm-pure
1919
+	 * @psalm-assert lowercase-string|null $value
1920
+	 *
1921
+	 * @param string|null $value
1922
+	 * @param string      $message
1923
+	 *
1924
+	 * @throws InvalidArgumentException
1925
+	 *
1926
+	 * @return void
1927
+	 */
1928
+	public static function nullOrLower($value, $message = '')
1929
+	{
1930
+		static::__callStatic('nullOrLower', array($value, $message));
1931
+	}
1932
+
1933
+	/**
1934
+	 * @psalm-pure
1935
+	 * @psalm-assert iterable<lowercase-string> $value
1936
+	 *
1937
+	 * @param iterable<string> $value
1938
+	 * @param string           $message
1939
+	 *
1940
+	 * @throws InvalidArgumentException
1941
+	 *
1942
+	 * @return void
1943
+	 */
1944
+	public static function allLower($value, $message = '')
1945
+	{
1946
+		static::__callStatic('allLower', array($value, $message));
1947
+	}
1948
+
1949
+	/**
1950
+	 * @psalm-pure
1951
+	 *
1952
+	 * @param string|null $value
1953
+	 * @param string      $message
1954
+	 *
1955
+	 * @throws InvalidArgumentException
1956
+	 *
1957
+	 * @return void
1958
+	 */
1959
+	public static function nullOrUpper($value, $message = '')
1960
+	{
1961
+		static::__callStatic('nullOrUpper', array($value, $message));
1962
+	}
1963
+
1964
+	/**
1965
+	 * @psalm-pure
1966
+	 *
1967
+	 * @param iterable<string> $value
1968
+	 * @param string           $message
1969
+	 *
1970
+	 * @throws InvalidArgumentException
1971
+	 *
1972
+	 * @return void
1973
+	 */
1974
+	public static function allUpper($value, $message = '')
1975
+	{
1976
+		static::__callStatic('allUpper', array($value, $message));
1977
+	}
1978
+
1979
+	/**
1980
+	 * @psalm-pure
1981
+	 *
1982
+	 * @param string|null $value
1983
+	 * @param int         $length
1984
+	 * @param string      $message
1985
+	 *
1986
+	 * @throws InvalidArgumentException
1987
+	 *
1988
+	 * @return void
1989
+	 */
1990
+	public static function nullOrLength($value, $length, $message = '')
1991
+	{
1992
+		static::__callStatic('nullOrLength', array($value, $length, $message));
1993
+	}
1994
+
1995
+	/**
1996
+	 * @psalm-pure
1997
+	 *
1998
+	 * @param iterable<string> $value
1999
+	 * @param int              $length
2000
+	 * @param string           $message
2001
+	 *
2002
+	 * @throws InvalidArgumentException
2003
+	 *
2004
+	 * @return void
2005
+	 */
2006
+	public static function allLength($value, $length, $message = '')
2007
+	{
2008
+		static::__callStatic('allLength', array($value, $length, $message));
2009
+	}
2010
+
2011
+	/**
2012
+	 * @psalm-pure
2013
+	 *
2014
+	 * @param string|null $value
2015
+	 * @param int|float   $min
2016
+	 * @param string      $message
2017
+	 *
2018
+	 * @throws InvalidArgumentException
2019
+	 *
2020
+	 * @return void
2021
+	 */
2022
+	public static function nullOrMinLength($value, $min, $message = '')
2023
+	{
2024
+		static::__callStatic('nullOrMinLength', array($value, $min, $message));
2025
+	}
2026
+
2027
+	/**
2028
+	 * @psalm-pure
2029
+	 *
2030
+	 * @param iterable<string> $value
2031
+	 * @param int|float        $min
2032
+	 * @param string           $message
2033
+	 *
2034
+	 * @throws InvalidArgumentException
2035
+	 *
2036
+	 * @return void
2037
+	 */
2038
+	public static function allMinLength($value, $min, $message = '')
2039
+	{
2040
+		static::__callStatic('allMinLength', array($value, $min, $message));
2041
+	}
2042
+
2043
+	/**
2044
+	 * @psalm-pure
2045
+	 *
2046
+	 * @param string|null $value
2047
+	 * @param int|float   $max
2048
+	 * @param string      $message
2049
+	 *
2050
+	 * @throws InvalidArgumentException
2051
+	 *
2052
+	 * @return void
2053
+	 */
2054
+	public static function nullOrMaxLength($value, $max, $message = '')
2055
+	{
2056
+		static::__callStatic('nullOrMaxLength', array($value, $max, $message));
2057
+	}
2058
+
2059
+	/**
2060
+	 * @psalm-pure
2061
+	 *
2062
+	 * @param iterable<string> $value
2063
+	 * @param int|float        $max
2064
+	 * @param string           $message
2065
+	 *
2066
+	 * @throws InvalidArgumentException
2067
+	 *
2068
+	 * @return void
2069
+	 */
2070
+	public static function allMaxLength($value, $max, $message = '')
2071
+	{
2072
+		static::__callStatic('allMaxLength', array($value, $max, $message));
2073
+	}
2074
+
2075
+	/**
2076
+	 * @psalm-pure
2077
+	 *
2078
+	 * @param string|null $value
2079
+	 * @param int|float   $min
2080
+	 * @param int|float   $max
2081
+	 * @param string      $message
2082
+	 *
2083
+	 * @throws InvalidArgumentException
2084
+	 *
2085
+	 * @return void
2086
+	 */
2087
+	public static function nullOrLengthBetween($value, $min, $max, $message = '')
2088
+	{
2089
+		static::__callStatic('nullOrLengthBetween', array($value, $min, $max, $message));
2090
+	}
2091
+
2092
+	/**
2093
+	 * @psalm-pure
2094
+	 *
2095
+	 * @param iterable<string> $value
2096
+	 * @param int|float        $min
2097
+	 * @param int|float        $max
2098
+	 * @param string           $message
2099
+	 *
2100
+	 * @throws InvalidArgumentException
2101
+	 *
2102
+	 * @return void
2103
+	 */
2104
+	public static function allLengthBetween($value, $min, $max, $message = '')
2105
+	{
2106
+		static::__callStatic('allLengthBetween', array($value, $min, $max, $message));
2107
+	}
2108
+
2109
+	/**
2110
+	 * @param mixed  $value
2111
+	 * @param string $message
2112
+	 *
2113
+	 * @throws InvalidArgumentException
2114
+	 *
2115
+	 * @return void
2116
+	 */
2117
+	public static function nullOrFileExists($value, $message = '')
2118
+	{
2119
+		static::__callStatic('nullOrFileExists', array($value, $message));
2120
+	}
2121
+
2122
+	/**
2123
+	 * @param mixed  $value
2124
+	 * @param string $message
2125
+	 *
2126
+	 * @throws InvalidArgumentException
2127
+	 *
2128
+	 * @return void
2129
+	 */
2130
+	public static function allFileExists($value, $message = '')
2131
+	{
2132
+		static::__callStatic('allFileExists', array($value, $message));
2133
+	}
2134
+
2135
+	/**
2136
+	 * @param mixed  $value
2137
+	 * @param string $message
2138
+	 *
2139
+	 * @throws InvalidArgumentException
2140
+	 *
2141
+	 * @return void
2142
+	 */
2143
+	public static function nullOrFile($value, $message = '')
2144
+	{
2145
+		static::__callStatic('nullOrFile', array($value, $message));
2146
+	}
2147
+
2148
+	/**
2149
+	 * @param mixed  $value
2150
+	 * @param string $message
2151
+	 *
2152
+	 * @throws InvalidArgumentException
2153
+	 *
2154
+	 * @return void
2155
+	 */
2156
+	public static function allFile($value, $message = '')
2157
+	{
2158
+		static::__callStatic('allFile', array($value, $message));
2159
+	}
2160
+
2161
+	/**
2162
+	 * @param mixed  $value
2163
+	 * @param string $message
2164
+	 *
2165
+	 * @throws InvalidArgumentException
2166
+	 *
2167
+	 * @return void
2168
+	 */
2169
+	public static function nullOrDirectory($value, $message = '')
2170
+	{
2171
+		static::__callStatic('nullOrDirectory', array($value, $message));
2172
+	}
2173
+
2174
+	/**
2175
+	 * @param mixed  $value
2176
+	 * @param string $message
2177
+	 *
2178
+	 * @throws InvalidArgumentException
2179
+	 *
2180
+	 * @return void
2181
+	 */
2182
+	public static function allDirectory($value, $message = '')
2183
+	{
2184
+		static::__callStatic('allDirectory', array($value, $message));
2185
+	}
2186
+
2187
+	/**
2188
+	 * @param string|null $value
2189
+	 * @param string      $message
2190
+	 *
2191
+	 * @throws InvalidArgumentException
2192
+	 *
2193
+	 * @return void
2194
+	 */
2195
+	public static function nullOrReadable($value, $message = '')
2196
+	{
2197
+		static::__callStatic('nullOrReadable', array($value, $message));
2198
+	}
2199
+
2200
+	/**
2201
+	 * @param iterable<string> $value
2202
+	 * @param string           $message
2203
+	 *
2204
+	 * @throws InvalidArgumentException
2205
+	 *
2206
+	 * @return void
2207
+	 */
2208
+	public static function allReadable($value, $message = '')
2209
+	{
2210
+		static::__callStatic('allReadable', array($value, $message));
2211
+	}
2212
+
2213
+	/**
2214
+	 * @param string|null $value
2215
+	 * @param string      $message
2216
+	 *
2217
+	 * @throws InvalidArgumentException
2218
+	 *
2219
+	 * @return void
2220
+	 */
2221
+	public static function nullOrWritable($value, $message = '')
2222
+	{
2223
+		static::__callStatic('nullOrWritable', array($value, $message));
2224
+	}
2225
+
2226
+	/**
2227
+	 * @param iterable<string> $value
2228
+	 * @param string           $message
2229
+	 *
2230
+	 * @throws InvalidArgumentException
2231
+	 *
2232
+	 * @return void
2233
+	 */
2234
+	public static function allWritable($value, $message = '')
2235
+	{
2236
+		static::__callStatic('allWritable', array($value, $message));
2237
+	}
2238
+
2239
+	/**
2240
+	 * @psalm-assert class-string|null $value
2241
+	 *
2242
+	 * @param mixed  $value
2243
+	 * @param string $message
2244
+	 *
2245
+	 * @throws InvalidArgumentException
2246
+	 *
2247
+	 * @return void
2248
+	 */
2249
+	public static function nullOrClassExists($value, $message = '')
2250
+	{
2251
+		static::__callStatic('nullOrClassExists', array($value, $message));
2252
+	}
2253
+
2254
+	/**
2255
+	 * @psalm-assert iterable<class-string> $value
2256
+	 *
2257
+	 * @param mixed  $value
2258
+	 * @param string $message
2259
+	 *
2260
+	 * @throws InvalidArgumentException
2261
+	 *
2262
+	 * @return void
2263
+	 */
2264
+	public static function allClassExists($value, $message = '')
2265
+	{
2266
+		static::__callStatic('allClassExists', array($value, $message));
2267
+	}
2268
+
2269
+	/**
2270
+	 * @psalm-pure
2271
+	 * @psalm-template ExpectedType of object
2272
+	 * @psalm-param class-string<ExpectedType> $class
2273
+	 * @psalm-assert class-string<ExpectedType>|ExpectedType|null $value
2274
+	 *
2275
+	 * @param mixed         $value
2276
+	 * @param string|object $class
2277
+	 * @param string        $message
2278
+	 *
2279
+	 * @throws InvalidArgumentException
2280
+	 *
2281
+	 * @return void
2282
+	 */
2283
+	public static function nullOrSubclassOf($value, $class, $message = '')
2284
+	{
2285
+		static::__callStatic('nullOrSubclassOf', array($value, $class, $message));
2286
+	}
2287
+
2288
+	/**
2289
+	 * @psalm-pure
2290
+	 * @psalm-template ExpectedType of object
2291
+	 * @psalm-param class-string<ExpectedType> $class
2292
+	 * @psalm-assert iterable<class-string<ExpectedType>|ExpectedType> $value
2293
+	 *
2294
+	 * @param mixed         $value
2295
+	 * @param string|object $class
2296
+	 * @param string        $message
2297
+	 *
2298
+	 * @throws InvalidArgumentException
2299
+	 *
2300
+	 * @return void
2301
+	 */
2302
+	public static function allSubclassOf($value, $class, $message = '')
2303
+	{
2304
+		static::__callStatic('allSubclassOf', array($value, $class, $message));
2305
+	}
2306
+
2307
+	/**
2308
+	 * @psalm-assert class-string|null $value
2309
+	 *
2310
+	 * @param mixed  $value
2311
+	 * @param string $message
2312
+	 *
2313
+	 * @throws InvalidArgumentException
2314
+	 *
2315
+	 * @return void
2316
+	 */
2317
+	public static function nullOrInterfaceExists($value, $message = '')
2318
+	{
2319
+		static::__callStatic('nullOrInterfaceExists', array($value, $message));
2320
+	}
2321
+
2322
+	/**
2323
+	 * @psalm-assert iterable<class-string> $value
2324
+	 *
2325
+	 * @param mixed  $value
2326
+	 * @param string $message
2327
+	 *
2328
+	 * @throws InvalidArgumentException
2329
+	 *
2330
+	 * @return void
2331
+	 */
2332
+	public static function allInterfaceExists($value, $message = '')
2333
+	{
2334
+		static::__callStatic('allInterfaceExists', array($value, $message));
2335
+	}
2336
+
2337
+	/**
2338
+	 * @psalm-pure
2339
+	 * @psalm-template ExpectedType of object
2340
+	 * @psalm-param class-string<ExpectedType> $interface
2341
+	 * @psalm-assert class-string<ExpectedType>|null $value
2342
+	 *
2343
+	 * @param mixed  $value
2344
+	 * @param mixed  $interface
2345
+	 * @param string $message
2346
+	 *
2347
+	 * @throws InvalidArgumentException
2348
+	 *
2349
+	 * @return void
2350
+	 */
2351
+	public static function nullOrImplementsInterface($value, $interface, $message = '')
2352
+	{
2353
+		static::__callStatic('nullOrImplementsInterface', array($value, $interface, $message));
2354
+	}
2355
+
2356
+	/**
2357
+	 * @psalm-pure
2358
+	 * @psalm-template ExpectedType of object
2359
+	 * @psalm-param class-string<ExpectedType> $interface
2360
+	 * @psalm-assert iterable<class-string<ExpectedType>> $value
2361
+	 *
2362
+	 * @param mixed  $value
2363
+	 * @param mixed  $interface
2364
+	 * @param string $message
2365
+	 *
2366
+	 * @throws InvalidArgumentException
2367
+	 *
2368
+	 * @return void
2369
+	 */
2370
+	public static function allImplementsInterface($value, $interface, $message = '')
2371
+	{
2372
+		static::__callStatic('allImplementsInterface', array($value, $interface, $message));
2373
+	}
2374
+
2375
+	/**
2376
+	 * @psalm-pure
2377
+	 * @psalm-param class-string|object|null $classOrObject
2378
+	 *
2379
+	 * @param string|object|null $classOrObject
2380
+	 * @param mixed              $property
2381
+	 * @param string             $message
2382
+	 *
2383
+	 * @throws InvalidArgumentException
2384
+	 *
2385
+	 * @return void
2386
+	 */
2387
+	public static function nullOrPropertyExists($classOrObject, $property, $message = '')
2388
+	{
2389
+		static::__callStatic('nullOrPropertyExists', array($classOrObject, $property, $message));
2390
+	}
2391
+
2392
+	/**
2393
+	 * @psalm-pure
2394
+	 * @psalm-param iterable<class-string|object> $classOrObject
2395
+	 *
2396
+	 * @param iterable<string|object> $classOrObject
2397
+	 * @param mixed                   $property
2398
+	 * @param string                  $message
2399
+	 *
2400
+	 * @throws InvalidArgumentException
2401
+	 *
2402
+	 * @return void
2403
+	 */
2404
+	public static function allPropertyExists($classOrObject, $property, $message = '')
2405
+	{
2406
+		static::__callStatic('allPropertyExists', array($classOrObject, $property, $message));
2407
+	}
2408
+
2409
+	/**
2410
+	 * @psalm-pure
2411
+	 * @psalm-param class-string|object|null $classOrObject
2412
+	 *
2413
+	 * @param string|object|null $classOrObject
2414
+	 * @param mixed              $property
2415
+	 * @param string             $message
2416
+	 *
2417
+	 * @throws InvalidArgumentException
2418
+	 *
2419
+	 * @return void
2420
+	 */
2421
+	public static function nullOrPropertyNotExists($classOrObject, $property, $message = '')
2422
+	{
2423
+		static::__callStatic('nullOrPropertyNotExists', array($classOrObject, $property, $message));
2424
+	}
2425
+
2426
+	/**
2427
+	 * @psalm-pure
2428
+	 * @psalm-param iterable<class-string|object> $classOrObject
2429
+	 *
2430
+	 * @param iterable<string|object> $classOrObject
2431
+	 * @param mixed                   $property
2432
+	 * @param string                  $message
2433
+	 *
2434
+	 * @throws InvalidArgumentException
2435
+	 *
2436
+	 * @return void
2437
+	 */
2438
+	public static function allPropertyNotExists($classOrObject, $property, $message = '')
2439
+	{
2440
+		static::__callStatic('allPropertyNotExists', array($classOrObject, $property, $message));
2441
+	}
2442
+
2443
+	/**
2444
+	 * @psalm-pure
2445
+	 * @psalm-param class-string|object|null $classOrObject
2446
+	 *
2447
+	 * @param string|object|null $classOrObject
2448
+	 * @param mixed              $method
2449
+	 * @param string             $message
2450
+	 *
2451
+	 * @throws InvalidArgumentException
2452
+	 *
2453
+	 * @return void
2454
+	 */
2455
+	public static function nullOrMethodExists($classOrObject, $method, $message = '')
2456
+	{
2457
+		static::__callStatic('nullOrMethodExists', array($classOrObject, $method, $message));
2458
+	}
2459
+
2460
+	/**
2461
+	 * @psalm-pure
2462
+	 * @psalm-param iterable<class-string|object> $classOrObject
2463
+	 *
2464
+	 * @param iterable<string|object> $classOrObject
2465
+	 * @param mixed                   $method
2466
+	 * @param string                  $message
2467
+	 *
2468
+	 * @throws InvalidArgumentException
2469
+	 *
2470
+	 * @return void
2471
+	 */
2472
+	public static function allMethodExists($classOrObject, $method, $message = '')
2473
+	{
2474
+		static::__callStatic('allMethodExists', array($classOrObject, $method, $message));
2475
+	}
2476
+
2477
+	/**
2478
+	 * @psalm-pure
2479
+	 * @psalm-param class-string|object|null $classOrObject
2480
+	 *
2481
+	 * @param string|object|null $classOrObject
2482
+	 * @param mixed              $method
2483
+	 * @param string             $message
2484
+	 *
2485
+	 * @throws InvalidArgumentException
2486
+	 *
2487
+	 * @return void
2488
+	 */
2489
+	public static function nullOrMethodNotExists($classOrObject, $method, $message = '')
2490
+	{
2491
+		static::__callStatic('nullOrMethodNotExists', array($classOrObject, $method, $message));
2492
+	}
2493
+
2494
+	/**
2495
+	 * @psalm-pure
2496
+	 * @psalm-param iterable<class-string|object> $classOrObject
2497
+	 *
2498
+	 * @param iterable<string|object> $classOrObject
2499
+	 * @param mixed                   $method
2500
+	 * @param string                  $message
2501
+	 *
2502
+	 * @throws InvalidArgumentException
2503
+	 *
2504
+	 * @return void
2505
+	 */
2506
+	public static function allMethodNotExists($classOrObject, $method, $message = '')
2507
+	{
2508
+		static::__callStatic('allMethodNotExists', array($classOrObject, $method, $message));
2509
+	}
2510
+
2511
+	/**
2512
+	 * @psalm-pure
2513
+	 *
2514
+	 * @param array|null $array
2515
+	 * @param string|int $key
2516
+	 * @param string     $message
2517
+	 *
2518
+	 * @throws InvalidArgumentException
2519
+	 *
2520
+	 * @return void
2521
+	 */
2522
+	public static function nullOrKeyExists($array, $key, $message = '')
2523
+	{
2524
+		static::__callStatic('nullOrKeyExists', array($array, $key, $message));
2525
+	}
2526
+
2527
+	/**
2528
+	 * @psalm-pure
2529
+	 *
2530
+	 * @param iterable<array> $array
2531
+	 * @param string|int      $key
2532
+	 * @param string          $message
2533
+	 *
2534
+	 * @throws InvalidArgumentException
2535
+	 *
2536
+	 * @return void
2537
+	 */
2538
+	public static function allKeyExists($array, $key, $message = '')
2539
+	{
2540
+		static::__callStatic('allKeyExists', array($array, $key, $message));
2541
+	}
2542
+
2543
+	/**
2544
+	 * @psalm-pure
2545
+	 *
2546
+	 * @param array|null $array
2547
+	 * @param string|int $key
2548
+	 * @param string     $message
2549
+	 *
2550
+	 * @throws InvalidArgumentException
2551
+	 *
2552
+	 * @return void
2553
+	 */
2554
+	public static function nullOrKeyNotExists($array, $key, $message = '')
2555
+	{
2556
+		static::__callStatic('nullOrKeyNotExists', array($array, $key, $message));
2557
+	}
2558
+
2559
+	/**
2560
+	 * @psalm-pure
2561
+	 *
2562
+	 * @param iterable<array> $array
2563
+	 * @param string|int      $key
2564
+	 * @param string          $message
2565
+	 *
2566
+	 * @throws InvalidArgumentException
2567
+	 *
2568
+	 * @return void
2569
+	 */
2570
+	public static function allKeyNotExists($array, $key, $message = '')
2571
+	{
2572
+		static::__callStatic('allKeyNotExists', array($array, $key, $message));
2573
+	}
2574
+
2575
+	/**
2576
+	 * @psalm-pure
2577
+	 * @psalm-assert array-key|null $value
2578
+	 *
2579
+	 * @param mixed  $value
2580
+	 * @param string $message
2581
+	 *
2582
+	 * @throws InvalidArgumentException
2583
+	 *
2584
+	 * @return void
2585
+	 */
2586
+	public static function nullOrValidArrayKey($value, $message = '')
2587
+	{
2588
+		static::__callStatic('nullOrValidArrayKey', array($value, $message));
2589
+	}
2590
+
2591
+	/**
2592
+	 * @psalm-pure
2593
+	 * @psalm-assert iterable<array-key> $value
2594
+	 *
2595
+	 * @param mixed  $value
2596
+	 * @param string $message
2597
+	 *
2598
+	 * @throws InvalidArgumentException
2599
+	 *
2600
+	 * @return void
2601
+	 */
2602
+	public static function allValidArrayKey($value, $message = '')
2603
+	{
2604
+		static::__callStatic('allValidArrayKey', array($value, $message));
2605
+	}
2606
+
2607
+	/**
2608
+	 * @param Countable|array|null $array
2609
+	 * @param int                  $number
2610
+	 * @param string               $message
2611
+	 *
2612
+	 * @throws InvalidArgumentException
2613
+	 *
2614
+	 * @return void
2615
+	 */
2616
+	public static function nullOrCount($array, $number, $message = '')
2617
+	{
2618
+		static::__callStatic('nullOrCount', array($array, $number, $message));
2619
+	}
2620
+
2621
+	/**
2622
+	 * @param iterable<Countable|array> $array
2623
+	 * @param int                       $number
2624
+	 * @param string                    $message
2625
+	 *
2626
+	 * @throws InvalidArgumentException
2627
+	 *
2628
+	 * @return void
2629
+	 */
2630
+	public static function allCount($array, $number, $message = '')
2631
+	{
2632
+		static::__callStatic('allCount', array($array, $number, $message));
2633
+	}
2634
+
2635
+	/**
2636
+	 * @param Countable|array|null $array
2637
+	 * @param int|float            $min
2638
+	 * @param string               $message
2639
+	 *
2640
+	 * @throws InvalidArgumentException
2641
+	 *
2642
+	 * @return void
2643
+	 */
2644
+	public static function nullOrMinCount($array, $min, $message = '')
2645
+	{
2646
+		static::__callStatic('nullOrMinCount', array($array, $min, $message));
2647
+	}
2648
+
2649
+	/**
2650
+	 * @param iterable<Countable|array> $array
2651
+	 * @param int|float                 $min
2652
+	 * @param string                    $message
2653
+	 *
2654
+	 * @throws InvalidArgumentException
2655
+	 *
2656
+	 * @return void
2657
+	 */
2658
+	public static function allMinCount($array, $min, $message = '')
2659
+	{
2660
+		static::__callStatic('allMinCount', array($array, $min, $message));
2661
+	}
2662
+
2663
+	/**
2664
+	 * @param Countable|array|null $array
2665
+	 * @param int|float            $max
2666
+	 * @param string               $message
2667
+	 *
2668
+	 * @throws InvalidArgumentException
2669
+	 *
2670
+	 * @return void
2671
+	 */
2672
+	public static function nullOrMaxCount($array, $max, $message = '')
2673
+	{
2674
+		static::__callStatic('nullOrMaxCount', array($array, $max, $message));
2675
+	}
2676
+
2677
+	/**
2678
+	 * @param iterable<Countable|array> $array
2679
+	 * @param int|float                 $max
2680
+	 * @param string                    $message
2681
+	 *
2682
+	 * @throws InvalidArgumentException
2683
+	 *
2684
+	 * @return void
2685
+	 */
2686
+	public static function allMaxCount($array, $max, $message = '')
2687
+	{
2688
+		static::__callStatic('allMaxCount', array($array, $max, $message));
2689
+	}
2690
+
2691
+	/**
2692
+	 * @param Countable|array|null $array
2693
+	 * @param int|float            $min
2694
+	 * @param int|float            $max
2695
+	 * @param string               $message
2696
+	 *
2697
+	 * @throws InvalidArgumentException
2698
+	 *
2699
+	 * @return void
2700
+	 */
2701
+	public static function nullOrCountBetween($array, $min, $max, $message = '')
2702
+	{
2703
+		static::__callStatic('nullOrCountBetween', array($array, $min, $max, $message));
2704
+	}
2705
+
2706
+	/**
2707
+	 * @param iterable<Countable|array> $array
2708
+	 * @param int|float                 $min
2709
+	 * @param int|float                 $max
2710
+	 * @param string                    $message
2711
+	 *
2712
+	 * @throws InvalidArgumentException
2713
+	 *
2714
+	 * @return void
2715
+	 */
2716
+	public static function allCountBetween($array, $min, $max, $message = '')
2717
+	{
2718
+		static::__callStatic('allCountBetween', array($array, $min, $max, $message));
2719
+	}
2720
+
2721
+	/**
2722
+	 * @psalm-pure
2723
+	 * @psalm-assert list|null $array
2724
+	 *
2725
+	 * @param mixed  $array
2726
+	 * @param string $message
2727
+	 *
2728
+	 * @throws InvalidArgumentException
2729
+	 *
2730
+	 * @return void
2731
+	 */
2732
+	public static function nullOrIsList($array, $message = '')
2733
+	{
2734
+		static::__callStatic('nullOrIsList', array($array, $message));
2735
+	}
2736
+
2737
+	/**
2738
+	 * @psalm-pure
2739
+	 * @psalm-assert iterable<list> $array
2740
+	 *
2741
+	 * @param mixed  $array
2742
+	 * @param string $message
2743
+	 *
2744
+	 * @throws InvalidArgumentException
2745
+	 *
2746
+	 * @return void
2747
+	 */
2748
+	public static function allIsList($array, $message = '')
2749
+	{
2750
+		static::__callStatic('allIsList', array($array, $message));
2751
+	}
2752
+
2753
+	/**
2754
+	 * @psalm-pure
2755
+	 * @psalm-assert non-empty-list|null $array
2756
+	 *
2757
+	 * @param mixed  $array
2758
+	 * @param string $message
2759
+	 *
2760
+	 * @throws InvalidArgumentException
2761
+	 *
2762
+	 * @return void
2763
+	 */
2764
+	public static function nullOrIsNonEmptyList($array, $message = '')
2765
+	{
2766
+		static::__callStatic('nullOrIsNonEmptyList', array($array, $message));
2767
+	}
2768
+
2769
+	/**
2770
+	 * @psalm-pure
2771
+	 * @psalm-assert iterable<non-empty-list> $array
2772
+	 *
2773
+	 * @param mixed  $array
2774
+	 * @param string $message
2775
+	 *
2776
+	 * @throws InvalidArgumentException
2777
+	 *
2778
+	 * @return void
2779
+	 */
2780
+	public static function allIsNonEmptyList($array, $message = '')
2781
+	{
2782
+		static::__callStatic('allIsNonEmptyList', array($array, $message));
2783
+	}
2784
+
2785
+	/**
2786
+	 * @psalm-pure
2787
+	 * @psalm-template T
2788
+	 * @psalm-param mixed|array<T>|null $array
2789
+	 * @psalm-assert array<string, T>|null $array
2790
+	 *
2791
+	 * @param mixed  $array
2792
+	 * @param string $message
2793
+	 *
2794
+	 * @throws InvalidArgumentException
2795
+	 *
2796
+	 * @return void
2797
+	 */
2798
+	public static function nullOrIsMap($array, $message = '')
2799
+	{
2800
+		static::__callStatic('nullOrIsMap', array($array, $message));
2801
+	}
2802
+
2803
+	/**
2804
+	 * @psalm-pure
2805
+	 * @psalm-template T
2806
+	 * @psalm-param iterable<mixed|array<T>> $array
2807
+	 * @psalm-assert iterable<array<string, T>> $array
2808
+	 *
2809
+	 * @param mixed  $array
2810
+	 * @param string $message
2811
+	 *
2812
+	 * @throws InvalidArgumentException
2813
+	 *
2814
+	 * @return void
2815
+	 */
2816
+	public static function allIsMap($array, $message = '')
2817
+	{
2818
+		static::__callStatic('allIsMap', array($array, $message));
2819
+	}
2820
+
2821
+	/**
2822
+	 * @psalm-pure
2823
+	 * @psalm-template T
2824
+	 * @psalm-param mixed|array<T>|null $array
2825
+	 *
2826
+	 * @param mixed  $array
2827
+	 * @param string $message
2828
+	 *
2829
+	 * @throws InvalidArgumentException
2830
+	 *
2831
+	 * @return void
2832
+	 */
2833
+	public static function nullOrIsNonEmptyMap($array, $message = '')
2834
+	{
2835
+		static::__callStatic('nullOrIsNonEmptyMap', array($array, $message));
2836
+	}
2837
+
2838
+	/**
2839
+	 * @psalm-pure
2840
+	 * @psalm-template T
2841
+	 * @psalm-param iterable<mixed|array<T>> $array
2842
+	 *
2843
+	 * @param mixed  $array
2844
+	 * @param string $message
2845
+	 *
2846
+	 * @throws InvalidArgumentException
2847
+	 *
2848
+	 * @return void
2849
+	 */
2850
+	public static function allIsNonEmptyMap($array, $message = '')
2851
+	{
2852
+		static::__callStatic('allIsNonEmptyMap', array($array, $message));
2853
+	}
2854
+
2855
+	/**
2856
+	 * @psalm-pure
2857
+	 *
2858
+	 * @param string|null $value
2859
+	 * @param string      $message
2860
+	 *
2861
+	 * @throws InvalidArgumentException
2862
+	 *
2863
+	 * @return void
2864
+	 */
2865
+	public static function nullOrUuid($value, $message = '')
2866
+	{
2867
+		static::__callStatic('nullOrUuid', array($value, $message));
2868
+	}
2869
+
2870
+	/**
2871
+	 * @psalm-pure
2872
+	 *
2873
+	 * @param iterable<string> $value
2874
+	 * @param string           $message
2875
+	 *
2876
+	 * @throws InvalidArgumentException
2877
+	 *
2878
+	 * @return void
2879
+	 */
2880
+	public static function allUuid($value, $message = '')
2881
+	{
2882
+		static::__callStatic('allUuid', array($value, $message));
2883
+	}
2884
+
2885
+	/**
2886
+	 * @psalm-param class-string<Throwable> $class
2887
+	 *
2888
+	 * @param Closure|null $expression
2889
+	 * @param string       $class
2890
+	 * @param string       $message
2891
+	 *
2892
+	 * @throws InvalidArgumentException
2893
+	 *
2894
+	 * @return void
2895
+	 */
2896
+	public static function nullOrThrows($expression, $class = 'Exception', $message = '')
2897
+	{
2898
+		static::__callStatic('nullOrThrows', array($expression, $class, $message));
2899
+	}
2900
+
2901
+	/**
2902
+	 * @psalm-param class-string<Throwable> $class
2903
+	 *
2904
+	 * @param iterable<Closure> $expression
2905
+	 * @param string            $class
2906
+	 * @param string            $message
2907
+	 *
2908
+	 * @throws InvalidArgumentException
2909
+	 *
2910
+	 * @return void
2911
+	 */
2912
+	public static function allThrows($expression, $class = 'Exception', $message = '')
2913
+	{
2914
+		static::__callStatic('allThrows', array($expression, $class, $message));
2915
+	}
2916 2916
 }
Please login to merge, or discard this patch.
vendor/phpdocumentor/type-resolver/src/TypeResolver.php 2 patches
Indentation   +643 added lines, -643 removed lines patch added patch discarded remove patch
@@ -54,647 +54,647 @@
 block discarded – undo
54 54
 
55 55
 final class TypeResolver
56 56
 {
57
-    /** @var string Definition of the ARRAY operator for types */
58
-    private const OPERATOR_ARRAY = '[]';
59
-
60
-    /** @var string Definition of the NAMESPACE operator in PHP */
61
-    private const OPERATOR_NAMESPACE = '\\';
62
-
63
-    /** @var int the iterator parser is inside a compound context */
64
-    private const PARSER_IN_COMPOUND = 0;
65
-
66
-    /** @var int the iterator parser is inside a nullable expression context */
67
-    private const PARSER_IN_NULLABLE = 1;
68
-
69
-    /** @var int the iterator parser is inside an array expression context */
70
-    private const PARSER_IN_ARRAY_EXPRESSION = 2;
71
-
72
-    /** @var int the iterator parser is inside a collection expression context */
73
-    private const PARSER_IN_COLLECTION_EXPRESSION = 3;
74
-
75
-    /**
76
-     * @var array<string, string> List of recognized keywords and unto which Value Object they map
77
-     * @psalm-var array<string, class-string<Type>>
78
-     */
79
-    private $keywords = [
80
-        'string' => Types\String_::class,
81
-        'class-string' => Types\ClassString::class,
82
-        'interface-string' => Types\InterfaceString::class,
83
-        'html-escaped-string' => PseudoTypes\HtmlEscapedString::class,
84
-        'lowercase-string' => PseudoTypes\LowercaseString::class,
85
-        'non-empty-lowercase-string' => PseudoTypes\NonEmptyLowercaseString::class,
86
-        'non-empty-string' => PseudoTypes\NonEmptyString::class,
87
-        'numeric-string' => PseudoTypes\NumericString::class,
88
-        'numeric' => PseudoTypes\Numeric_::class,
89
-        'trait-string' => PseudoTypes\TraitString::class,
90
-        'int' => Types\Integer::class,
91
-        'integer' => Types\Integer::class,
92
-        'positive-int' => PseudoTypes\PositiveInteger::class,
93
-        'negative-int' => PseudoTypes\NegativeInteger::class,
94
-        'bool' => Types\Boolean::class,
95
-        'boolean' => Types\Boolean::class,
96
-        'real' => Types\Float_::class,
97
-        'float' => Types\Float_::class,
98
-        'double' => Types\Float_::class,
99
-        'object' => Types\Object_::class,
100
-        'mixed' => Types\Mixed_::class,
101
-        'array' => Types\Array_::class,
102
-        'array-key' => Types\ArrayKey::class,
103
-        'resource' => Types\Resource_::class,
104
-        'void' => Types\Void_::class,
105
-        'null' => Types\Null_::class,
106
-        'scalar' => Types\Scalar::class,
107
-        'callback' => Types\Callable_::class,
108
-        'callable' => Types\Callable_::class,
109
-        'callable-string' => PseudoTypes\CallableString::class,
110
-        'false' => PseudoTypes\False_::class,
111
-        'true' => PseudoTypes\True_::class,
112
-        'literal-string' => PseudoTypes\LiteralString::class,
113
-        'self' => Types\Self_::class,
114
-        '$this' => Types\This::class,
115
-        'static' => Types\Static_::class,
116
-        'parent' => Types\Parent_::class,
117
-        'iterable' => Types\Iterable_::class,
118
-        'never' => Types\Never_::class,
119
-        'list' => PseudoTypes\List_::class,
120
-    ];
121
-
122
-    /**
123
-     * @var FqsenResolver
124
-     * @psalm-readonly
125
-     */
126
-    private $fqsenResolver;
127
-
128
-    /**
129
-     * Initializes this TypeResolver with the means to create and resolve Fqsen objects.
130
-     */
131
-    public function __construct(?FqsenResolver $fqsenResolver = null)
132
-    {
133
-        $this->fqsenResolver = $fqsenResolver ?: new FqsenResolver();
134
-    }
135
-
136
-    /**
137
-     * Analyzes the given type and returns the FQCN variant.
138
-     *
139
-     * When a type is provided this method checks whether it is not a keyword or
140
-     * Fully Qualified Class Name. If so it will use the given namespace and
141
-     * aliases to expand the type to a FQCN representation.
142
-     *
143
-     * This method only works as expected if the namespace and aliases are set;
144
-     * no dynamic reflection is being performed here.
145
-     *
146
-     * @uses Context::getNamespaceAliases() to check whether the first part of the relative type name should not be
147
-     * replaced with another namespace.
148
-     * @uses Context::getNamespace()        to determine with what to prefix the type name.
149
-     *
150
-     * @param string $type The relative or absolute type.
151
-     */
152
-    public function resolve(string $type, ?Context $context = null): Type
153
-    {
154
-        $type = trim($type);
155
-        if (!$type) {
156
-            throw new InvalidArgumentException('Attempted to resolve "' . $type . '" but it appears to be empty');
157
-        }
158
-
159
-        if ($context === null) {
160
-            $context = new Context('');
161
-        }
162
-
163
-        // split the type string into tokens `|`, `?`, `<`, `>`, `,`, `(`, `)`, `[]`, '<', '>' and type names
164
-        $tokens = preg_split(
165
-            '/(\\||\\?|<|>|&|, ?|\\(|\\)|\\[\\]+)/',
166
-            $type,
167
-            -1,
168
-            PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE
169
-        );
170
-
171
-        if ($tokens === false) {
172
-            throw new InvalidArgumentException('Unable to split the type string "' . $type . '" into tokens');
173
-        }
174
-
175
-        /** @var ArrayIterator<int, string|null> $tokenIterator */
176
-        $tokenIterator = new ArrayIterator($tokens);
177
-
178
-        return $this->parseTypes($tokenIterator, $context, self::PARSER_IN_COMPOUND);
179
-    }
180
-
181
-    /**
182
-     * Analyse each tokens and creates types
183
-     *
184
-     * @param ArrayIterator<int, string|null> $tokens        the iterator on tokens
185
-     * @param int                        $parserContext on of self::PARSER_* constants, indicating
186
-     * the context where we are in the parsing
187
-     */
188
-    private function parseTypes(ArrayIterator $tokens, Context $context, int $parserContext): Type
189
-    {
190
-        $types = [];
191
-        $token = '';
192
-        $compoundToken = '|';
193
-        while ($tokens->valid()) {
194
-            $token = $tokens->current();
195
-            if ($token === null) {
196
-                throw new RuntimeException(
197
-                    'Unexpected nullable character'
198
-                );
199
-            }
200
-
201
-            if ($token === '|' || $token === '&') {
202
-                if (count($types) === 0) {
203
-                    throw new RuntimeException(
204
-                        'A type is missing before a type separator'
205
-                    );
206
-                }
207
-
208
-                if (
209
-                    !in_array($parserContext, [
210
-                        self::PARSER_IN_COMPOUND,
211
-                        self::PARSER_IN_ARRAY_EXPRESSION,
212
-                        self::PARSER_IN_COLLECTION_EXPRESSION,
213
-                    ], true)
214
-                ) {
215
-                    throw new RuntimeException(
216
-                        'Unexpected type separator'
217
-                    );
218
-                }
219
-
220
-                $compoundToken = $token;
221
-                $tokens->next();
222
-            } elseif ($token === '?') {
223
-                if (
224
-                    !in_array($parserContext, [
225
-                        self::PARSER_IN_COMPOUND,
226
-                        self::PARSER_IN_ARRAY_EXPRESSION,
227
-                        self::PARSER_IN_COLLECTION_EXPRESSION,
228
-                    ], true)
229
-                ) {
230
-                    throw new RuntimeException(
231
-                        'Unexpected nullable character'
232
-                    );
233
-                }
234
-
235
-                $tokens->next();
236
-                $type    = $this->parseTypes($tokens, $context, self::PARSER_IN_NULLABLE);
237
-                $types[] = new Nullable($type);
238
-            } elseif ($token === '(') {
239
-                $tokens->next();
240
-                $type = $this->parseTypes($tokens, $context, self::PARSER_IN_ARRAY_EXPRESSION);
241
-
242
-                $token = $tokens->current();
243
-                if ($token === null) { // Someone did not properly close their array expression ..
244
-                    break;
245
-                }
246
-
247
-                $tokens->next();
248
-
249
-                $resolvedType = new Expression($type);
250
-
251
-                $types[] = $resolvedType;
252
-            } elseif ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION && isset($token[0]) && $token[0] === ')') {
253
-                break;
254
-            } elseif ($token === '<') {
255
-                if (count($types) === 0) {
256
-                    throw new RuntimeException(
257
-                        'Unexpected collection operator "<", class name is missing'
258
-                    );
259
-                }
260
-
261
-                $classType = array_pop($types);
262
-                if ($classType !== null) {
263
-                    if ((string) $classType === 'class-string') {
264
-                        $types[] = $this->resolveClassString($tokens, $context);
265
-                    } elseif ((string) $classType === 'int') {
266
-                        $types[] = $this->resolveIntRange($tokens);
267
-                    } elseif ((string) $classType === 'interface-string') {
268
-                        $types[] = $this->resolveInterfaceString($tokens, $context);
269
-                    } else {
270
-                        $types[] = $this->resolveCollection($tokens, $classType, $context);
271
-                    }
272
-                }
273
-
274
-                $tokens->next();
275
-            } elseif (
276
-                $parserContext === self::PARSER_IN_COLLECTION_EXPRESSION
277
-                && ($token === '>' || trim($token) === ',')
278
-            ) {
279
-                break;
280
-            } elseif ($token === self::OPERATOR_ARRAY) {
281
-                end($types);
282
-                $last = key($types);
283
-                if ($last === null) {
284
-                    throw new InvalidArgumentException('Unexpected array operator');
285
-                }
286
-
287
-                $lastItem = $types[$last];
288
-                if ($lastItem instanceof Expression) {
289
-                    $lastItem = $lastItem->getValueType();
290
-                }
291
-
292
-                $types[$last] = new Array_($lastItem);
293
-
294
-                $tokens->next();
295
-            } else {
296
-                $type = $this->resolveSingleType($token, $context);
297
-                $tokens->next();
298
-                if ($parserContext === self::PARSER_IN_NULLABLE) {
299
-                    return $type;
300
-                }
301
-
302
-                $types[] = $type;
303
-            }
304
-        }
305
-
306
-        if ($token === '|' || $token === '&') {
307
-            throw new RuntimeException(
308
-                'A type is missing after a type separator'
309
-            );
310
-        }
311
-
312
-        if (count($types) === 0) {
313
-            if ($parserContext === self::PARSER_IN_NULLABLE) {
314
-                throw new RuntimeException(
315
-                    'A type is missing after a nullable character'
316
-                );
317
-            }
318
-
319
-            if ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION) {
320
-                throw new RuntimeException(
321
-                    'A type is missing in an array expression'
322
-                );
323
-            }
324
-
325
-            if ($parserContext === self::PARSER_IN_COLLECTION_EXPRESSION) {
326
-                throw new RuntimeException(
327
-                    'A type is missing in a collection expression'
328
-                );
329
-            }
330
-        } elseif (count($types) === 1) {
331
-            return current($types);
332
-        }
333
-
334
-        if ($compoundToken === '|') {
335
-            return new Compound(array_values($types));
336
-        }
337
-
338
-        return new Intersection(array_values($types));
339
-    }
340
-
341
-    /**
342
-     * resolve the given type into a type object
343
-     *
344
-     * @param string $type the type string, representing a single type
345
-     *
346
-     * @return Type|Array_|Object_
347
-     *
348
-     * @psalm-mutation-free
349
-     */
350
-    private function resolveSingleType(string $type, Context $context): object
351
-    {
352
-        switch (true) {
353
-            case $this->isKeyword($type):
354
-                return $this->resolveKeyword($type);
355
-
356
-            case $this->isFqsen($type):
357
-                return $this->resolveTypedObject($type);
358
-
359
-            case $this->isPartialStructuralElementName($type):
360
-                return $this->resolveTypedObject($type, $context);
361
-
362
-            // @codeCoverageIgnoreStart
363
-            default:
364
-                // I haven't got the foggiest how the logic would come here but added this as a defense.
365
-                throw new RuntimeException(
366
-                    'Unable to resolve type "' . $type . '", there is no known method to resolve it'
367
-                );
368
-        }
369
-
370
-        // @codeCoverageIgnoreEnd
371
-    }
372
-
373
-    /**
374
-     * Adds a keyword to the list of Keywords and associates it with a specific Value Object.
375
-     *
376
-     * @psalm-param class-string<Type> $typeClassName
377
-     */
378
-    public function addKeyword(string $keyword, string $typeClassName): void
379
-    {
380
-        if (!class_exists($typeClassName)) {
381
-            throw new InvalidArgumentException(
382
-                'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class'
383
-                . ' but we could not find the class ' . $typeClassName
384
-            );
385
-        }
386
-
387
-        $interfaces = class_implements($typeClassName);
388
-        if ($interfaces === false) {
389
-            throw new InvalidArgumentException(
390
-                'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class'
391
-                . ' but we could not find the class ' . $typeClassName
392
-            );
393
-        }
394
-
395
-        if (!in_array(Type::class, $interfaces, true)) {
396
-            throw new InvalidArgumentException(
397
-                'The class "' . $typeClassName . '" must implement the interface "phpDocumentor\Reflection\Type"'
398
-            );
399
-        }
400
-
401
-        $this->keywords[$keyword] = $typeClassName;
402
-    }
403
-
404
-    /**
405
-     * Detects whether the given type represents a PHPDoc keyword.
406
-     *
407
-     * @param string $type A relative or absolute type as defined in the phpDocumentor documentation.
408
-     *
409
-     * @psalm-mutation-free
410
-     */
411
-    private function isKeyword(string $type): bool
412
-    {
413
-        return array_key_exists(strtolower($type), $this->keywords);
414
-    }
415
-
416
-    /**
417
-     * Detects whether the given type represents a relative structural element name.
418
-     *
419
-     * @param string $type A relative or absolute type as defined in the phpDocumentor documentation.
420
-     *
421
-     * @psalm-mutation-free
422
-     */
423
-    private function isPartialStructuralElementName(string $type): bool
424
-    {
425
-        return (isset($type[0]) && $type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type);
426
-    }
427
-
428
-    /**
429
-     * Tests whether the given type is a Fully Qualified Structural Element Name.
430
-     *
431
-     * @psalm-mutation-free
432
-     */
433
-    private function isFqsen(string $type): bool
434
-    {
435
-        return strpos($type, self::OPERATOR_NAMESPACE) === 0;
436
-    }
437
-
438
-    /**
439
-     * Resolves the given keyword (such as `string`) into a Type object representing that keyword.
440
-     *
441
-     * @psalm-mutation-free
442
-     */
443
-    private function resolveKeyword(string $type): Type
444
-    {
445
-        $className = $this->keywords[strtolower($type)];
446
-
447
-        return new $className();
448
-    }
449
-
450
-    /**
451
-     * Resolves the given FQSEN string into an FQSEN object.
452
-     *
453
-     * @psalm-mutation-free
454
-     */
455
-    private function resolveTypedObject(string $type, ?Context $context = null): Object_
456
-    {
457
-        return new Object_($this->fqsenResolver->resolve($type, $context));
458
-    }
459
-
460
-    /**
461
-     * Resolves class string
462
-     *
463
-     * @param ArrayIterator<int, (string|null)> $tokens
464
-     */
465
-    private function resolveClassString(ArrayIterator $tokens, Context $context): Type
466
-    {
467
-        $tokens->next();
468
-
469
-        $classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
470
-
471
-        if (!$classType instanceof Object_ || $classType->getFqsen() === null) {
472
-            throw new RuntimeException(
473
-                $classType . ' is not a class string'
474
-            );
475
-        }
476
-
477
-        $token = $tokens->current();
478
-        if ($token !== '>') {
479
-            if (empty($token)) {
480
-                throw new RuntimeException(
481
-                    'class-string: ">" is missing'
482
-                );
483
-            }
484
-
485
-            throw new RuntimeException(
486
-                'Unexpected character "' . $token . '", ">" is missing'
487
-            );
488
-        }
489
-
490
-        return new ClassString($classType->getFqsen());
491
-    }
492
-
493
-    /**
494
-     * Resolves integer ranges
495
-     *
496
-     * @param ArrayIterator<int, (string|null)> $tokens
497
-     */
498
-    private function resolveIntRange(ArrayIterator $tokens): Type
499
-    {
500
-        $tokens->next();
501
-
502
-        $token = '';
503
-        $minValue = null;
504
-        $maxValue = null;
505
-        $commaFound = false;
506
-        $tokenCounter = 0;
507
-        while ($tokens->valid()) {
508
-            $tokenCounter++;
509
-            $token = $tokens->current();
510
-            if ($token === null) {
511
-                throw new RuntimeException(
512
-                    'Unexpected nullable character'
513
-                );
514
-            }
515
-
516
-            $token = trim($token);
517
-
518
-            if ($token === '>') {
519
-                break;
520
-            }
521
-
522
-            if ($token === ',') {
523
-                $commaFound = true;
524
-            }
525
-
526
-            if ($commaFound === false && $minValue === null) {
527
-                if (is_numeric($token) || $token === 'max' || $token === 'min') {
528
-                    $minValue = $token;
529
-                }
530
-            }
531
-
532
-            if ($commaFound === true && $maxValue === null) {
533
-                if (is_numeric($token) || $token === 'max' || $token === 'min') {
534
-                    $maxValue = $token;
535
-                }
536
-            }
537
-
538
-            $tokens->next();
539
-        }
540
-
541
-        if ($token !== '>') {
542
-            if (empty($token)) {
543
-                throw new RuntimeException(
544
-                    'interface-string: ">" is missing'
545
-                );
546
-            }
547
-
548
-            throw new RuntimeException(
549
-                'Unexpected character "' . $token . '", ">" is missing'
550
-            );
551
-        }
552
-
553
-        if ($minValue === null || $maxValue === null || $tokenCounter > 4) {
554
-            throw new RuntimeException(
555
-                'int<min,max> has not the correct format'
556
-            );
557
-        }
558
-
559
-        return new IntegerRange($minValue, $maxValue);
560
-    }
561
-
562
-    /**
563
-     * Resolves class string
564
-     *
565
-     * @param ArrayIterator<int, (string|null)> $tokens
566
-     */
567
-    private function resolveInterfaceString(ArrayIterator $tokens, Context $context): Type
568
-    {
569
-        $tokens->next();
570
-
571
-        $classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
572
-
573
-        if (!$classType instanceof Object_ || $classType->getFqsen() === null) {
574
-            throw new RuntimeException(
575
-                $classType . ' is not a interface string'
576
-            );
577
-        }
578
-
579
-        $token = $tokens->current();
580
-        if ($token !== '>') {
581
-            if (empty($token)) {
582
-                throw new RuntimeException(
583
-                    'interface-string: ">" is missing'
584
-                );
585
-            }
586
-
587
-            throw new RuntimeException(
588
-                'Unexpected character "' . $token . '", ">" is missing'
589
-            );
590
-        }
591
-
592
-        return new InterfaceString($classType->getFqsen());
593
-    }
594
-
595
-    /**
596
-     * Resolves the collection values and keys
597
-     *
598
-     * @param ArrayIterator<int, (string|null)> $tokens
599
-     *
600
-     * @return Array_|Iterable_|Collection
601
-     */
602
-    private function resolveCollection(ArrayIterator $tokens, Type $classType, Context $context): Type
603
-    {
604
-        $isArray    = ((string) $classType === 'array');
605
-        $isIterable = ((string) $classType === 'iterable');
606
-        $isList     = ((string) $classType === 'list');
607
-
608
-        // allow only "array", "iterable" or class name before "<"
609
-        if (
610
-            !$isArray && !$isIterable && !$isList
611
-            && (!$classType instanceof Object_ || $classType->getFqsen() === null)
612
-        ) {
613
-            throw new RuntimeException(
614
-                $classType . ' is not a collection'
615
-            );
616
-        }
617
-
618
-        $tokens->next();
619
-
620
-        $valueType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
621
-        $keyType   = null;
622
-
623
-        $token = $tokens->current();
624
-        if ($token !== null && trim($token) === ',' && !$isList) {
625
-            // if we have a comma, then we just parsed the key type, not the value type
626
-            $keyType = $valueType;
627
-            if ($isArray) {
628
-                // check the key type for an "array" collection. We allow only
629
-                // strings or integers.
630
-                if (
631
-                    !$keyType instanceof ArrayKey &&
632
-                    !$keyType instanceof String_ &&
633
-                    !$keyType instanceof Integer &&
634
-                    !$keyType instanceof Compound
635
-                ) {
636
-                    throw new RuntimeException(
637
-                        'An array can have only integers or strings as keys'
638
-                    );
639
-                }
640
-
641
-                if ($keyType instanceof Compound) {
642
-                    foreach ($keyType->getIterator() as $item) {
643
-                        if (
644
-                            !$item instanceof ArrayKey &&
645
-                            !$item instanceof String_ &&
646
-                            !$item instanceof Integer
647
-                        ) {
648
-                            throw new RuntimeException(
649
-                                'An array can have only integers or strings as keys'
650
-                            );
651
-                        }
652
-                    }
653
-                }
654
-            }
655
-
656
-            $tokens->next();
657
-            // now let's parse the value type
658
-            $valueType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
659
-        }
660
-
661
-        $token = $tokens->current();
662
-        if ($token !== '>') {
663
-            if (empty($token)) {
664
-                throw new RuntimeException(
665
-                    'Collection: ">" is missing'
666
-                );
667
-            }
668
-
669
-            throw new RuntimeException(
670
-                'Unexpected character "' . $token . '", ">" is missing'
671
-            );
672
-        }
673
-
674
-        if ($isArray) {
675
-            return new Array_($valueType, $keyType);
676
-        }
677
-
678
-        if ($isIterable) {
679
-            return new Iterable_($valueType, $keyType);
680
-        }
681
-
682
-        if ($isList) {
683
-            return new List_($valueType);
684
-        }
685
-
686
-        if ($classType instanceof Object_) {
687
-            return $this->makeCollectionFromObject($classType, $valueType, $keyType);
688
-        }
689
-
690
-        throw new RuntimeException('Invalid $classType provided');
691
-    }
692
-
693
-    /**
694
-     * @psalm-pure
695
-     */
696
-    private function makeCollectionFromObject(Object_ $object, Type $valueType, ?Type $keyType = null): Collection
697
-    {
698
-        return new Collection($object->getFqsen(), $valueType, $keyType);
699
-    }
57
+	/** @var string Definition of the ARRAY operator for types */
58
+	private const OPERATOR_ARRAY = '[]';
59
+
60
+	/** @var string Definition of the NAMESPACE operator in PHP */
61
+	private const OPERATOR_NAMESPACE = '\\';
62
+
63
+	/** @var int the iterator parser is inside a compound context */
64
+	private const PARSER_IN_COMPOUND = 0;
65
+
66
+	/** @var int the iterator parser is inside a nullable expression context */
67
+	private const PARSER_IN_NULLABLE = 1;
68
+
69
+	/** @var int the iterator parser is inside an array expression context */
70
+	private const PARSER_IN_ARRAY_EXPRESSION = 2;
71
+
72
+	/** @var int the iterator parser is inside a collection expression context */
73
+	private const PARSER_IN_COLLECTION_EXPRESSION = 3;
74
+
75
+	/**
76
+	 * @var array<string, string> List of recognized keywords and unto which Value Object they map
77
+	 * @psalm-var array<string, class-string<Type>>
78
+	 */
79
+	private $keywords = [
80
+		'string' => Types\String_::class,
81
+		'class-string' => Types\ClassString::class,
82
+		'interface-string' => Types\InterfaceString::class,
83
+		'html-escaped-string' => PseudoTypes\HtmlEscapedString::class,
84
+		'lowercase-string' => PseudoTypes\LowercaseString::class,
85
+		'non-empty-lowercase-string' => PseudoTypes\NonEmptyLowercaseString::class,
86
+		'non-empty-string' => PseudoTypes\NonEmptyString::class,
87
+		'numeric-string' => PseudoTypes\NumericString::class,
88
+		'numeric' => PseudoTypes\Numeric_::class,
89
+		'trait-string' => PseudoTypes\TraitString::class,
90
+		'int' => Types\Integer::class,
91
+		'integer' => Types\Integer::class,
92
+		'positive-int' => PseudoTypes\PositiveInteger::class,
93
+		'negative-int' => PseudoTypes\NegativeInteger::class,
94
+		'bool' => Types\Boolean::class,
95
+		'boolean' => Types\Boolean::class,
96
+		'real' => Types\Float_::class,
97
+		'float' => Types\Float_::class,
98
+		'double' => Types\Float_::class,
99
+		'object' => Types\Object_::class,
100
+		'mixed' => Types\Mixed_::class,
101
+		'array' => Types\Array_::class,
102
+		'array-key' => Types\ArrayKey::class,
103
+		'resource' => Types\Resource_::class,
104
+		'void' => Types\Void_::class,
105
+		'null' => Types\Null_::class,
106
+		'scalar' => Types\Scalar::class,
107
+		'callback' => Types\Callable_::class,
108
+		'callable' => Types\Callable_::class,
109
+		'callable-string' => PseudoTypes\CallableString::class,
110
+		'false' => PseudoTypes\False_::class,
111
+		'true' => PseudoTypes\True_::class,
112
+		'literal-string' => PseudoTypes\LiteralString::class,
113
+		'self' => Types\Self_::class,
114
+		'$this' => Types\This::class,
115
+		'static' => Types\Static_::class,
116
+		'parent' => Types\Parent_::class,
117
+		'iterable' => Types\Iterable_::class,
118
+		'never' => Types\Never_::class,
119
+		'list' => PseudoTypes\List_::class,
120
+	];
121
+
122
+	/**
123
+	 * @var FqsenResolver
124
+	 * @psalm-readonly
125
+	 */
126
+	private $fqsenResolver;
127
+
128
+	/**
129
+	 * Initializes this TypeResolver with the means to create and resolve Fqsen objects.
130
+	 */
131
+	public function __construct(?FqsenResolver $fqsenResolver = null)
132
+	{
133
+		$this->fqsenResolver = $fqsenResolver ?: new FqsenResolver();
134
+	}
135
+
136
+	/**
137
+	 * Analyzes the given type and returns the FQCN variant.
138
+	 *
139
+	 * When a type is provided this method checks whether it is not a keyword or
140
+	 * Fully Qualified Class Name. If so it will use the given namespace and
141
+	 * aliases to expand the type to a FQCN representation.
142
+	 *
143
+	 * This method only works as expected if the namespace and aliases are set;
144
+	 * no dynamic reflection is being performed here.
145
+	 *
146
+	 * @uses Context::getNamespaceAliases() to check whether the first part of the relative type name should not be
147
+	 * replaced with another namespace.
148
+	 * @uses Context::getNamespace()        to determine with what to prefix the type name.
149
+	 *
150
+	 * @param string $type The relative or absolute type.
151
+	 */
152
+	public function resolve(string $type, ?Context $context = null): Type
153
+	{
154
+		$type = trim($type);
155
+		if (!$type) {
156
+			throw new InvalidArgumentException('Attempted to resolve "' . $type . '" but it appears to be empty');
157
+		}
158
+
159
+		if ($context === null) {
160
+			$context = new Context('');
161
+		}
162
+
163
+		// split the type string into tokens `|`, `?`, `<`, `>`, `,`, `(`, `)`, `[]`, '<', '>' and type names
164
+		$tokens = preg_split(
165
+			'/(\\||\\?|<|>|&|, ?|\\(|\\)|\\[\\]+)/',
166
+			$type,
167
+			-1,
168
+			PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE
169
+		);
170
+
171
+		if ($tokens === false) {
172
+			throw new InvalidArgumentException('Unable to split the type string "' . $type . '" into tokens');
173
+		}
174
+
175
+		/** @var ArrayIterator<int, string|null> $tokenIterator */
176
+		$tokenIterator = new ArrayIterator($tokens);
177
+
178
+		return $this->parseTypes($tokenIterator, $context, self::PARSER_IN_COMPOUND);
179
+	}
180
+
181
+	/**
182
+	 * Analyse each tokens and creates types
183
+	 *
184
+	 * @param ArrayIterator<int, string|null> $tokens        the iterator on tokens
185
+	 * @param int                        $parserContext on of self::PARSER_* constants, indicating
186
+	 * the context where we are in the parsing
187
+	 */
188
+	private function parseTypes(ArrayIterator $tokens, Context $context, int $parserContext): Type
189
+	{
190
+		$types = [];
191
+		$token = '';
192
+		$compoundToken = '|';
193
+		while ($tokens->valid()) {
194
+			$token = $tokens->current();
195
+			if ($token === null) {
196
+				throw new RuntimeException(
197
+					'Unexpected nullable character'
198
+				);
199
+			}
200
+
201
+			if ($token === '|' || $token === '&') {
202
+				if (count($types) === 0) {
203
+					throw new RuntimeException(
204
+						'A type is missing before a type separator'
205
+					);
206
+				}
207
+
208
+				if (
209
+					!in_array($parserContext, [
210
+						self::PARSER_IN_COMPOUND,
211
+						self::PARSER_IN_ARRAY_EXPRESSION,
212
+						self::PARSER_IN_COLLECTION_EXPRESSION,
213
+					], true)
214
+				) {
215
+					throw new RuntimeException(
216
+						'Unexpected type separator'
217
+					);
218
+				}
219
+
220
+				$compoundToken = $token;
221
+				$tokens->next();
222
+			} elseif ($token === '?') {
223
+				if (
224
+					!in_array($parserContext, [
225
+						self::PARSER_IN_COMPOUND,
226
+						self::PARSER_IN_ARRAY_EXPRESSION,
227
+						self::PARSER_IN_COLLECTION_EXPRESSION,
228
+					], true)
229
+				) {
230
+					throw new RuntimeException(
231
+						'Unexpected nullable character'
232
+					);
233
+				}
234
+
235
+				$tokens->next();
236
+				$type    = $this->parseTypes($tokens, $context, self::PARSER_IN_NULLABLE);
237
+				$types[] = new Nullable($type);
238
+			} elseif ($token === '(') {
239
+				$tokens->next();
240
+				$type = $this->parseTypes($tokens, $context, self::PARSER_IN_ARRAY_EXPRESSION);
241
+
242
+				$token = $tokens->current();
243
+				if ($token === null) { // Someone did not properly close their array expression ..
244
+					break;
245
+				}
246
+
247
+				$tokens->next();
248
+
249
+				$resolvedType = new Expression($type);
250
+
251
+				$types[] = $resolvedType;
252
+			} elseif ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION && isset($token[0]) && $token[0] === ')') {
253
+				break;
254
+			} elseif ($token === '<') {
255
+				if (count($types) === 0) {
256
+					throw new RuntimeException(
257
+						'Unexpected collection operator "<", class name is missing'
258
+					);
259
+				}
260
+
261
+				$classType = array_pop($types);
262
+				if ($classType !== null) {
263
+					if ((string) $classType === 'class-string') {
264
+						$types[] = $this->resolveClassString($tokens, $context);
265
+					} elseif ((string) $classType === 'int') {
266
+						$types[] = $this->resolveIntRange($tokens);
267
+					} elseif ((string) $classType === 'interface-string') {
268
+						$types[] = $this->resolveInterfaceString($tokens, $context);
269
+					} else {
270
+						$types[] = $this->resolveCollection($tokens, $classType, $context);
271
+					}
272
+				}
273
+
274
+				$tokens->next();
275
+			} elseif (
276
+				$parserContext === self::PARSER_IN_COLLECTION_EXPRESSION
277
+				&& ($token === '>' || trim($token) === ',')
278
+			) {
279
+				break;
280
+			} elseif ($token === self::OPERATOR_ARRAY) {
281
+				end($types);
282
+				$last = key($types);
283
+				if ($last === null) {
284
+					throw new InvalidArgumentException('Unexpected array operator');
285
+				}
286
+
287
+				$lastItem = $types[$last];
288
+				if ($lastItem instanceof Expression) {
289
+					$lastItem = $lastItem->getValueType();
290
+				}
291
+
292
+				$types[$last] = new Array_($lastItem);
293
+
294
+				$tokens->next();
295
+			} else {
296
+				$type = $this->resolveSingleType($token, $context);
297
+				$tokens->next();
298
+				if ($parserContext === self::PARSER_IN_NULLABLE) {
299
+					return $type;
300
+				}
301
+
302
+				$types[] = $type;
303
+			}
304
+		}
305
+
306
+		if ($token === '|' || $token === '&') {
307
+			throw new RuntimeException(
308
+				'A type is missing after a type separator'
309
+			);
310
+		}
311
+
312
+		if (count($types) === 0) {
313
+			if ($parserContext === self::PARSER_IN_NULLABLE) {
314
+				throw new RuntimeException(
315
+					'A type is missing after a nullable character'
316
+				);
317
+			}
318
+
319
+			if ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION) {
320
+				throw new RuntimeException(
321
+					'A type is missing in an array expression'
322
+				);
323
+			}
324
+
325
+			if ($parserContext === self::PARSER_IN_COLLECTION_EXPRESSION) {
326
+				throw new RuntimeException(
327
+					'A type is missing in a collection expression'
328
+				);
329
+			}
330
+		} elseif (count($types) === 1) {
331
+			return current($types);
332
+		}
333
+
334
+		if ($compoundToken === '|') {
335
+			return new Compound(array_values($types));
336
+		}
337
+
338
+		return new Intersection(array_values($types));
339
+	}
340
+
341
+	/**
342
+	 * resolve the given type into a type object
343
+	 *
344
+	 * @param string $type the type string, representing a single type
345
+	 *
346
+	 * @return Type|Array_|Object_
347
+	 *
348
+	 * @psalm-mutation-free
349
+	 */
350
+	private function resolveSingleType(string $type, Context $context): object
351
+	{
352
+		switch (true) {
353
+			case $this->isKeyword($type):
354
+				return $this->resolveKeyword($type);
355
+
356
+			case $this->isFqsen($type):
357
+				return $this->resolveTypedObject($type);
358
+
359
+			case $this->isPartialStructuralElementName($type):
360
+				return $this->resolveTypedObject($type, $context);
361
+
362
+			// @codeCoverageIgnoreStart
363
+			default:
364
+				// I haven't got the foggiest how the logic would come here but added this as a defense.
365
+				throw new RuntimeException(
366
+					'Unable to resolve type "' . $type . '", there is no known method to resolve it'
367
+				);
368
+		}
369
+
370
+		// @codeCoverageIgnoreEnd
371
+	}
372
+
373
+	/**
374
+	 * Adds a keyword to the list of Keywords and associates it with a specific Value Object.
375
+	 *
376
+	 * @psalm-param class-string<Type> $typeClassName
377
+	 */
378
+	public function addKeyword(string $keyword, string $typeClassName): void
379
+	{
380
+		if (!class_exists($typeClassName)) {
381
+			throw new InvalidArgumentException(
382
+				'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class'
383
+				. ' but we could not find the class ' . $typeClassName
384
+			);
385
+		}
386
+
387
+		$interfaces = class_implements($typeClassName);
388
+		if ($interfaces === false) {
389
+			throw new InvalidArgumentException(
390
+				'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class'
391
+				. ' but we could not find the class ' . $typeClassName
392
+			);
393
+		}
394
+
395
+		if (!in_array(Type::class, $interfaces, true)) {
396
+			throw new InvalidArgumentException(
397
+				'The class "' . $typeClassName . '" must implement the interface "phpDocumentor\Reflection\Type"'
398
+			);
399
+		}
400
+
401
+		$this->keywords[$keyword] = $typeClassName;
402
+	}
403
+
404
+	/**
405
+	 * Detects whether the given type represents a PHPDoc keyword.
406
+	 *
407
+	 * @param string $type A relative or absolute type as defined in the phpDocumentor documentation.
408
+	 *
409
+	 * @psalm-mutation-free
410
+	 */
411
+	private function isKeyword(string $type): bool
412
+	{
413
+		return array_key_exists(strtolower($type), $this->keywords);
414
+	}
415
+
416
+	/**
417
+	 * Detects whether the given type represents a relative structural element name.
418
+	 *
419
+	 * @param string $type A relative or absolute type as defined in the phpDocumentor documentation.
420
+	 *
421
+	 * @psalm-mutation-free
422
+	 */
423
+	private function isPartialStructuralElementName(string $type): bool
424
+	{
425
+		return (isset($type[0]) && $type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type);
426
+	}
427
+
428
+	/**
429
+	 * Tests whether the given type is a Fully Qualified Structural Element Name.
430
+	 *
431
+	 * @psalm-mutation-free
432
+	 */
433
+	private function isFqsen(string $type): bool
434
+	{
435
+		return strpos($type, self::OPERATOR_NAMESPACE) === 0;
436
+	}
437
+
438
+	/**
439
+	 * Resolves the given keyword (such as `string`) into a Type object representing that keyword.
440
+	 *
441
+	 * @psalm-mutation-free
442
+	 */
443
+	private function resolveKeyword(string $type): Type
444
+	{
445
+		$className = $this->keywords[strtolower($type)];
446
+
447
+		return new $className();
448
+	}
449
+
450
+	/**
451
+	 * Resolves the given FQSEN string into an FQSEN object.
452
+	 *
453
+	 * @psalm-mutation-free
454
+	 */
455
+	private function resolveTypedObject(string $type, ?Context $context = null): Object_
456
+	{
457
+		return new Object_($this->fqsenResolver->resolve($type, $context));
458
+	}
459
+
460
+	/**
461
+	 * Resolves class string
462
+	 *
463
+	 * @param ArrayIterator<int, (string|null)> $tokens
464
+	 */
465
+	private function resolveClassString(ArrayIterator $tokens, Context $context): Type
466
+	{
467
+		$tokens->next();
468
+
469
+		$classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
470
+
471
+		if (!$classType instanceof Object_ || $classType->getFqsen() === null) {
472
+			throw new RuntimeException(
473
+				$classType . ' is not a class string'
474
+			);
475
+		}
476
+
477
+		$token = $tokens->current();
478
+		if ($token !== '>') {
479
+			if (empty($token)) {
480
+				throw new RuntimeException(
481
+					'class-string: ">" is missing'
482
+				);
483
+			}
484
+
485
+			throw new RuntimeException(
486
+				'Unexpected character "' . $token . '", ">" is missing'
487
+			);
488
+		}
489
+
490
+		return new ClassString($classType->getFqsen());
491
+	}
492
+
493
+	/**
494
+	 * Resolves integer ranges
495
+	 *
496
+	 * @param ArrayIterator<int, (string|null)> $tokens
497
+	 */
498
+	private function resolveIntRange(ArrayIterator $tokens): Type
499
+	{
500
+		$tokens->next();
501
+
502
+		$token = '';
503
+		$minValue = null;
504
+		$maxValue = null;
505
+		$commaFound = false;
506
+		$tokenCounter = 0;
507
+		while ($tokens->valid()) {
508
+			$tokenCounter++;
509
+			$token = $tokens->current();
510
+			if ($token === null) {
511
+				throw new RuntimeException(
512
+					'Unexpected nullable character'
513
+				);
514
+			}
515
+
516
+			$token = trim($token);
517
+
518
+			if ($token === '>') {
519
+				break;
520
+			}
521
+
522
+			if ($token === ',') {
523
+				$commaFound = true;
524
+			}
525
+
526
+			if ($commaFound === false && $minValue === null) {
527
+				if (is_numeric($token) || $token === 'max' || $token === 'min') {
528
+					$minValue = $token;
529
+				}
530
+			}
531
+
532
+			if ($commaFound === true && $maxValue === null) {
533
+				if (is_numeric($token) || $token === 'max' || $token === 'min') {
534
+					$maxValue = $token;
535
+				}
536
+			}
537
+
538
+			$tokens->next();
539
+		}
540
+
541
+		if ($token !== '>') {
542
+			if (empty($token)) {
543
+				throw new RuntimeException(
544
+					'interface-string: ">" is missing'
545
+				);
546
+			}
547
+
548
+			throw new RuntimeException(
549
+				'Unexpected character "' . $token . '", ">" is missing'
550
+			);
551
+		}
552
+
553
+		if ($minValue === null || $maxValue === null || $tokenCounter > 4) {
554
+			throw new RuntimeException(
555
+				'int<min,max> has not the correct format'
556
+			);
557
+		}
558
+
559
+		return new IntegerRange($minValue, $maxValue);
560
+	}
561
+
562
+	/**
563
+	 * Resolves class string
564
+	 *
565
+	 * @param ArrayIterator<int, (string|null)> $tokens
566
+	 */
567
+	private function resolveInterfaceString(ArrayIterator $tokens, Context $context): Type
568
+	{
569
+		$tokens->next();
570
+
571
+		$classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
572
+
573
+		if (!$classType instanceof Object_ || $classType->getFqsen() === null) {
574
+			throw new RuntimeException(
575
+				$classType . ' is not a interface string'
576
+			);
577
+		}
578
+
579
+		$token = $tokens->current();
580
+		if ($token !== '>') {
581
+			if (empty($token)) {
582
+				throw new RuntimeException(
583
+					'interface-string: ">" is missing'
584
+				);
585
+			}
586
+
587
+			throw new RuntimeException(
588
+				'Unexpected character "' . $token . '", ">" is missing'
589
+			);
590
+		}
591
+
592
+		return new InterfaceString($classType->getFqsen());
593
+	}
594
+
595
+	/**
596
+	 * Resolves the collection values and keys
597
+	 *
598
+	 * @param ArrayIterator<int, (string|null)> $tokens
599
+	 *
600
+	 * @return Array_|Iterable_|Collection
601
+	 */
602
+	private function resolveCollection(ArrayIterator $tokens, Type $classType, Context $context): Type
603
+	{
604
+		$isArray    = ((string) $classType === 'array');
605
+		$isIterable = ((string) $classType === 'iterable');
606
+		$isList     = ((string) $classType === 'list');
607
+
608
+		// allow only "array", "iterable" or class name before "<"
609
+		if (
610
+			!$isArray && !$isIterable && !$isList
611
+			&& (!$classType instanceof Object_ || $classType->getFqsen() === null)
612
+		) {
613
+			throw new RuntimeException(
614
+				$classType . ' is not a collection'
615
+			);
616
+		}
617
+
618
+		$tokens->next();
619
+
620
+		$valueType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
621
+		$keyType   = null;
622
+
623
+		$token = $tokens->current();
624
+		if ($token !== null && trim($token) === ',' && !$isList) {
625
+			// if we have a comma, then we just parsed the key type, not the value type
626
+			$keyType = $valueType;
627
+			if ($isArray) {
628
+				// check the key type for an "array" collection. We allow only
629
+				// strings or integers.
630
+				if (
631
+					!$keyType instanceof ArrayKey &&
632
+					!$keyType instanceof String_ &&
633
+					!$keyType instanceof Integer &&
634
+					!$keyType instanceof Compound
635
+				) {
636
+					throw new RuntimeException(
637
+						'An array can have only integers or strings as keys'
638
+					);
639
+				}
640
+
641
+				if ($keyType instanceof Compound) {
642
+					foreach ($keyType->getIterator() as $item) {
643
+						if (
644
+							!$item instanceof ArrayKey &&
645
+							!$item instanceof String_ &&
646
+							!$item instanceof Integer
647
+						) {
648
+							throw new RuntimeException(
649
+								'An array can have only integers or strings as keys'
650
+							);
651
+						}
652
+					}
653
+				}
654
+			}
655
+
656
+			$tokens->next();
657
+			// now let's parse the value type
658
+			$valueType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
659
+		}
660
+
661
+		$token = $tokens->current();
662
+		if ($token !== '>') {
663
+			if (empty($token)) {
664
+				throw new RuntimeException(
665
+					'Collection: ">" is missing'
666
+				);
667
+			}
668
+
669
+			throw new RuntimeException(
670
+				'Unexpected character "' . $token . '", ">" is missing'
671
+			);
672
+		}
673
+
674
+		if ($isArray) {
675
+			return new Array_($valueType, $keyType);
676
+		}
677
+
678
+		if ($isIterable) {
679
+			return new Iterable_($valueType, $keyType);
680
+		}
681
+
682
+		if ($isList) {
683
+			return new List_($valueType);
684
+		}
685
+
686
+		if ($classType instanceof Object_) {
687
+			return $this->makeCollectionFromObject($classType, $valueType, $keyType);
688
+		}
689
+
690
+		throw new RuntimeException('Invalid $classType provided');
691
+	}
692
+
693
+	/**
694
+	 * @psalm-pure
695
+	 */
696
+	private function makeCollectionFromObject(Object_ $object, Type $valueType, ?Type $keyType = null): Collection
697
+	{
698
+		return new Collection($object->getFqsen(), $valueType, $keyType);
699
+	}
700 700
 }
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
     public function resolve(string $type, ?Context $context = null): Type
153 153
     {
154 154
         $type = trim($type);
155
-        if (!$type) {
156
-            throw new InvalidArgumentException('Attempted to resolve "' . $type . '" but it appears to be empty');
155
+        if ( ! $type) {
156
+            throw new InvalidArgumentException('Attempted to resolve "'.$type.'" but it appears to be empty');
157 157
         }
158 158
 
159 159
         if ($context === null) {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         );
170 170
 
171 171
         if ($tokens === false) {
172
-            throw new InvalidArgumentException('Unable to split the type string "' . $type . '" into tokens');
172
+            throw new InvalidArgumentException('Unable to split the type string "'.$type.'" into tokens');
173 173
         }
174 174
 
175 175
         /** @var ArrayIterator<int, string|null> $tokenIterator */
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                 }
207 207
 
208 208
                 if (
209
-                    !in_array($parserContext, [
209
+                    ! in_array($parserContext, [
210 210
                         self::PARSER_IN_COMPOUND,
211 211
                         self::PARSER_IN_ARRAY_EXPRESSION,
212 212
                         self::PARSER_IN_COLLECTION_EXPRESSION,
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
                 $tokens->next();
222 222
             } elseif ($token === '?') {
223 223
                 if (
224
-                    !in_array($parserContext, [
224
+                    ! in_array($parserContext, [
225 225
                         self::PARSER_IN_COMPOUND,
226 226
                         self::PARSER_IN_ARRAY_EXPRESSION,
227 227
                         self::PARSER_IN_COLLECTION_EXPRESSION,
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
             default:
364 364
                 // I haven't got the foggiest how the logic would come here but added this as a defense.
365 365
                 throw new RuntimeException(
366
-                    'Unable to resolve type "' . $type . '", there is no known method to resolve it'
366
+                    'Unable to resolve type "'.$type.'", there is no known method to resolve it'
367 367
                 );
368 368
         }
369 369
 
@@ -377,24 +377,24 @@  discard block
 block discarded – undo
377 377
      */
378 378
     public function addKeyword(string $keyword, string $typeClassName): void
379 379
     {
380
-        if (!class_exists($typeClassName)) {
380
+        if ( ! class_exists($typeClassName)) {
381 381
             throw new InvalidArgumentException(
382
-                'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class'
383
-                . ' but we could not find the class ' . $typeClassName
382
+                'The Value Object that needs to be created with a keyword "'.$keyword.'" must be an existing class'
383
+                . ' but we could not find the class '.$typeClassName
384 384
             );
385 385
         }
386 386
 
387 387
         $interfaces = class_implements($typeClassName);
388 388
         if ($interfaces === false) {
389 389
             throw new InvalidArgumentException(
390
-                'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class'
391
-                . ' but we could not find the class ' . $typeClassName
390
+                'The Value Object that needs to be created with a keyword "'.$keyword.'" must be an existing class'
391
+                . ' but we could not find the class '.$typeClassName
392 392
             );
393 393
         }
394 394
 
395
-        if (!in_array(Type::class, $interfaces, true)) {
395
+        if ( ! in_array(Type::class, $interfaces, true)) {
396 396
             throw new InvalidArgumentException(
397
-                'The class "' . $typeClassName . '" must implement the interface "phpDocumentor\Reflection\Type"'
397
+                'The class "'.$typeClassName.'" must implement the interface "phpDocumentor\Reflection\Type"'
398 398
             );
399 399
         }
400 400
 
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
      */
423 423
     private function isPartialStructuralElementName(string $type): bool
424 424
     {
425
-        return (isset($type[0]) && $type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type);
425
+        return (isset($type[0]) && $type[0] !== self::OPERATOR_NAMESPACE) && ! $this->isKeyword($type);
426 426
     }
427 427
 
428 428
     /**
@@ -468,9 +468,9 @@  discard block
 block discarded – undo
468 468
 
469 469
         $classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
470 470
 
471
-        if (!$classType instanceof Object_ || $classType->getFqsen() === null) {
471
+        if ( ! $classType instanceof Object_ || $classType->getFqsen() === null) {
472 472
             throw new RuntimeException(
473
-                $classType . ' is not a class string'
473
+                $classType.' is not a class string'
474 474
             );
475 475
         }
476 476
 
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
             }
484 484
 
485 485
             throw new RuntimeException(
486
-                'Unexpected character "' . $token . '", ">" is missing'
486
+                'Unexpected character "'.$token.'", ">" is missing'
487 487
             );
488 488
         }
489 489
 
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
             }
547 547
 
548 548
             throw new RuntimeException(
549
-                'Unexpected character "' . $token . '", ">" is missing'
549
+                'Unexpected character "'.$token.'", ">" is missing'
550 550
             );
551 551
         }
552 552
 
@@ -570,9 +570,9 @@  discard block
 block discarded – undo
570 570
 
571 571
         $classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
572 572
 
573
-        if (!$classType instanceof Object_ || $classType->getFqsen() === null) {
573
+        if ( ! $classType instanceof Object_ || $classType->getFqsen() === null) {
574 574
             throw new RuntimeException(
575
-                $classType . ' is not a interface string'
575
+                $classType.' is not a interface string'
576 576
             );
577 577
         }
578 578
 
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
             }
586 586
 
587 587
             throw new RuntimeException(
588
-                'Unexpected character "' . $token . '", ">" is missing'
588
+                'Unexpected character "'.$token.'", ">" is missing'
589 589
             );
590 590
         }
591 591
 
@@ -607,11 +607,11 @@  discard block
 block discarded – undo
607 607
 
608 608
         // allow only "array", "iterable" or class name before "<"
609 609
         if (
610
-            !$isArray && !$isIterable && !$isList
611
-            && (!$classType instanceof Object_ || $classType->getFqsen() === null)
610
+            ! $isArray && ! $isIterable && ! $isList
611
+            && ( ! $classType instanceof Object_ || $classType->getFqsen() === null)
612 612
         ) {
613 613
             throw new RuntimeException(
614
-                $classType . ' is not a collection'
614
+                $classType.' is not a collection'
615 615
             );
616 616
         }
617 617
 
@@ -621,17 +621,17 @@  discard block
 block discarded – undo
621 621
         $keyType   = null;
622 622
 
623 623
         $token = $tokens->current();
624
-        if ($token !== null && trim($token) === ',' && !$isList) {
624
+        if ($token !== null && trim($token) === ',' && ! $isList) {
625 625
             // if we have a comma, then we just parsed the key type, not the value type
626 626
             $keyType = $valueType;
627 627
             if ($isArray) {
628 628
                 // check the key type for an "array" collection. We allow only
629 629
                 // strings or integers.
630 630
                 if (
631
-                    !$keyType instanceof ArrayKey &&
632
-                    !$keyType instanceof String_ &&
633
-                    !$keyType instanceof Integer &&
634
-                    !$keyType instanceof Compound
631
+                    ! $keyType instanceof ArrayKey &&
632
+                    ! $keyType instanceof String_ &&
633
+                    ! $keyType instanceof Integer &&
634
+                    ! $keyType instanceof Compound
635 635
                 ) {
636 636
                     throw new RuntimeException(
637 637
                         'An array can have only integers or strings as keys'
@@ -641,9 +641,9 @@  discard block
 block discarded – undo
641 641
                 if ($keyType instanceof Compound) {
642 642
                     foreach ($keyType->getIterator() as $item) {
643 643
                         if (
644
-                            !$item instanceof ArrayKey &&
645
-                            !$item instanceof String_ &&
646
-                            !$item instanceof Integer
644
+                            ! $item instanceof ArrayKey &&
645
+                            ! $item instanceof String_ &&
646
+                            ! $item instanceof Integer
647 647
                         ) {
648 648
                             throw new RuntimeException(
649 649
                                 'An array can have only integers or strings as keys'
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
             }
668 668
 
669 669
             throw new RuntimeException(
670
-                'Unexpected character "' . $token . '", ">" is missing'
670
+                'Unexpected character "'.$token.'", ">" is missing'
671 671
             );
672 672
         }
673 673
 
Please login to merge, or discard this patch.
widgets/upcoming_events/EEW_Upcoming_Events.widget.php 1 patch
Indentation   +618 added lines, -618 removed lines patch added patch discarded remove patch
@@ -12,109 +12,109 @@  discard block
 block discarded – undo
12 12
  */
13 13
 class EEW_Upcoming_Events extends EspressoWidget
14 14
 {
15
-    /**
16
-     * @var string
17
-     */
18
-    private $title;
19
-    /**
20
-     * @var string
21
-     */
22
-    private $events_category;
23
-
24
-    /**
25
-     * @var bool
26
-     */
27
-    private $show_expired;
28
-
29
-    /**
30
-     * @var string
31
-     */
32
-    private $image_size;
33
-
34
-    /**
35
-     * @var bool
36
-     */
37
-    private $show_desc;
38
-
39
-    /**
40
-     * @var bool
41
-     */
42
-    private $show_dates;
43
-
44
-    /**
45
-     * @var string
46
-     */
47
-    private $date_limit;
48
-
49
-    /**
50
-     * @var string
51
-     */
52
-    private $date_range;
53
-
54
-    /**
55
-     * @var string
56
-     */
57
-    private $limit;
58
-
59
-    /**
60
-     * @var string
61
-     */
62
-    private $order;
63
-
64
-
65
-    /**
66
-     * Register widget with WordPress.
67
-     */
68
-    public function __construct()
69
-    {
70
-        parent::__construct(
71
-            esc_html__('Event Espresso Upcoming Events', 'event_espresso'),
72
-            ['description' => esc_html__('A widget to display your upcoming events.', 'event_espresso')]
73
-        );
74
-    }
75
-
76
-
77
-    /**
78
-     * Back-end widget form.
79
-     *
80
-     * @param array $instance Previously saved values from database.
81
-     * @return void
82
-     * @throws EE_Error
83
-     * @throws ReflectionException
84
-     * @see WP_Widget::form()
85
-     */
86
-    public function form($instance)
87
-    {
88
-
89
-        EE_Registry::instance()->load_class('Question_Option', [], false, false, true);
90
-        // Set up some default widget settings.
91
-        $defaults = [
92
-            'title'           => esc_html__('Upcoming Events', 'event_espresso'),
93
-            'category_name'   => '',
94
-            'show_expired'    => 0,
95
-            'show_desc'       => true,
96
-            'show_dates'      => true,
97
-            'show_everywhere' => false,
98
-            'date_limit'      => 2,
99
-            'limit'           => 10,
100
-            'sort'            => 'ASC',
101
-            'date_range'      => false,
102
-            'image_size'      => 'medium',
103
-        ];
104
-
105
-        $instance = wp_parse_args((array) $instance, $defaults);
106
-        // don't add HTML labels for EE_Form_Fields generated inputs
107
-        add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string');
108
-        $yes_no_values = [
109
-            EE_Question_Option::new_instance(['QSO_value' => false, 'QSO_desc' => esc_html__('No', 'event_espresso')]),
110
-            EE_Question_Option::new_instance(['QSO_value' => true, 'QSO_desc' => esc_html__('Yes', 'event_espresso')]),
111
-        ];
112
-        $sort_values   = [
113
-            EE_Question_Option::new_instance(['QSO_value' => 'ASC', 'QSO_desc' => esc_html__('ASC', 'event_espresso')]),
114
-            EE_Question_Option::new_instance(['QSO_value' => 'DESC', 'QSO_desc' => esc_html__('DESC', 'event_espresso')]),
115
-        ];
116
-
117
-        ?>
15
+	/**
16
+	 * @var string
17
+	 */
18
+	private $title;
19
+	/**
20
+	 * @var string
21
+	 */
22
+	private $events_category;
23
+
24
+	/**
25
+	 * @var bool
26
+	 */
27
+	private $show_expired;
28
+
29
+	/**
30
+	 * @var string
31
+	 */
32
+	private $image_size;
33
+
34
+	/**
35
+	 * @var bool
36
+	 */
37
+	private $show_desc;
38
+
39
+	/**
40
+	 * @var bool
41
+	 */
42
+	private $show_dates;
43
+
44
+	/**
45
+	 * @var string
46
+	 */
47
+	private $date_limit;
48
+
49
+	/**
50
+	 * @var string
51
+	 */
52
+	private $date_range;
53
+
54
+	/**
55
+	 * @var string
56
+	 */
57
+	private $limit;
58
+
59
+	/**
60
+	 * @var string
61
+	 */
62
+	private $order;
63
+
64
+
65
+	/**
66
+	 * Register widget with WordPress.
67
+	 */
68
+	public function __construct()
69
+	{
70
+		parent::__construct(
71
+			esc_html__('Event Espresso Upcoming Events', 'event_espresso'),
72
+			['description' => esc_html__('A widget to display your upcoming events.', 'event_espresso')]
73
+		);
74
+	}
75
+
76
+
77
+	/**
78
+	 * Back-end widget form.
79
+	 *
80
+	 * @param array $instance Previously saved values from database.
81
+	 * @return void
82
+	 * @throws EE_Error
83
+	 * @throws ReflectionException
84
+	 * @see WP_Widget::form()
85
+	 */
86
+	public function form($instance)
87
+	{
88
+
89
+		EE_Registry::instance()->load_class('Question_Option', [], false, false, true);
90
+		// Set up some default widget settings.
91
+		$defaults = [
92
+			'title'           => esc_html__('Upcoming Events', 'event_espresso'),
93
+			'category_name'   => '',
94
+			'show_expired'    => 0,
95
+			'show_desc'       => true,
96
+			'show_dates'      => true,
97
+			'show_everywhere' => false,
98
+			'date_limit'      => 2,
99
+			'limit'           => 10,
100
+			'sort'            => 'ASC',
101
+			'date_range'      => false,
102
+			'image_size'      => 'medium',
103
+		];
104
+
105
+		$instance = wp_parse_args((array) $instance, $defaults);
106
+		// don't add HTML labels for EE_Form_Fields generated inputs
107
+		add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string');
108
+		$yes_no_values = [
109
+			EE_Question_Option::new_instance(['QSO_value' => false, 'QSO_desc' => esc_html__('No', 'event_espresso')]),
110
+			EE_Question_Option::new_instance(['QSO_value' => true, 'QSO_desc' => esc_html__('Yes', 'event_espresso')]),
111
+		];
112
+		$sort_values   = [
113
+			EE_Question_Option::new_instance(['QSO_value' => 'ASC', 'QSO_desc' => esc_html__('ASC', 'event_espresso')]),
114
+			EE_Question_Option::new_instance(['QSO_value' => 'DESC', 'QSO_desc' => esc_html__('DESC', 'event_espresso')]),
115
+		];
116
+
117
+		?>
118 118
 
119 119
         <!-- Widget Title: Text Input -->
120 120
 
@@ -151,38 +151,38 @@  discard block
 block discarded – undo
151 151
                 <?php esc_html_e('Show Expired Events:', 'event_espresso'); ?>
152 152
             </label>
153 153
             <?php
154
-            $show_expired_options   = $yes_no_values;
155
-            $show_expired_options[] = EE_Question_Option::new_instance(
156
-                ['QSO_value' => 2, 'QSO_desc' => esc_html__('Show Only Expired', 'event_espresso')]
157
-            );
158
-            echo wp_kses(
159
-                EEH_Form_Fields::select(
160
-                    esc_html__('Show Expired Events:', 'event_espresso'),
161
-                    $instance['show_expired'],
162
-                    $show_expired_options,
163
-                    $this->fieldName('show_expired'),
164
-                    $this->fieldID('show_expired')
165
-                ),
166
-                AllowedTags::getWithFormTags()
167
-            );
168
-            ?>
154
+			$show_expired_options   = $yes_no_values;
155
+			$show_expired_options[] = EE_Question_Option::new_instance(
156
+				['QSO_value' => 2, 'QSO_desc' => esc_html__('Show Only Expired', 'event_espresso')]
157
+			);
158
+			echo wp_kses(
159
+				EEH_Form_Fields::select(
160
+					esc_html__('Show Expired Events:', 'event_espresso'),
161
+					$instance['show_expired'],
162
+					$show_expired_options,
163
+					$this->fieldName('show_expired'),
164
+					$this->fieldID('show_expired')
165
+				),
166
+				AllowedTags::getWithFormTags()
167
+			);
168
+			?>
169 169
         </p>
170 170
         <p>
171 171
             <label for="<?php echo esc_attr($this->fieldID('sort')); ?>">
172 172
                 <?php esc_html_e('Sort Events:', 'event_espresso'); ?>
173 173
             </label>
174 174
             <?php
175
-            echo wp_kses(
176
-                EEH_Form_Fields::select(
177
-                    esc_html__('Sort Events:', 'event_espresso'),
178
-                    $instance['sort'],
179
-                    $sort_values,
180
-                    $this->fieldName('sort'),
181
-                    $this->fieldID('sort')
182
-                ),
183
-                AllowedTags::getWithFormTags()
184
-            );
185
-            ?>
175
+			echo wp_kses(
176
+				EEH_Form_Fields::select(
177
+					esc_html__('Sort Events:', 'event_espresso'),
178
+					$instance['sort'],
179
+					$sort_values,
180
+					$this->fieldName('sort'),
181
+					$this->fieldID('sort')
182
+				),
183
+				AllowedTags::getWithFormTags()
184
+			);
185
+			?>
186 186
         </p>
187 187
         <p>
188 188
             <label for="<?php echo esc_attr($this->fieldID('image_size')); ?>">
@@ -196,51 +196,51 @@  discard block
 block discarded – undo
196 196
                 <?php esc_html_e('Show Description:', 'event_espresso'); ?>
197 197
             </label>
198 198
             <?php
199
-            echo wp_kses(
200
-                EEH_Form_Fields::select(
201
-                    esc_html__('Show Description:', 'event_espresso'),
202
-                    $instance['show_desc'],
203
-                    $yes_no_values,
204
-                    $this->fieldName('show_desc'),
205
-                    $this->fieldID('show_desc')
206
-                ),
207
-                AllowedTags::getWithFormTags()
208
-            );
209
-            ?>
199
+			echo wp_kses(
200
+				EEH_Form_Fields::select(
201
+					esc_html__('Show Description:', 'event_espresso'),
202
+					$instance['show_desc'],
203
+					$yes_no_values,
204
+					$this->fieldName('show_desc'),
205
+					$this->fieldID('show_desc')
206
+				),
207
+				AllowedTags::getWithFormTags()
208
+			);
209
+			?>
210 210
         </p>
211 211
         <p>
212 212
             <label for="<?php echo esc_attr($this->fieldID('show_dates')); ?>">
213 213
                 <?php esc_html_e('Show Dates:', 'event_espresso'); ?>
214 214
             </label>
215 215
             <?php
216
-            echo wp_kses(
217
-                EEH_Form_Fields::select(
218
-                    esc_html__('Show Dates:', 'event_espresso'),
219
-                    $instance['show_dates'],
220
-                    $yes_no_values,
221
-                    $this->fieldName('show_dates'),
222
-                    $this->fieldID('show_dates')
223
-                ),
224
-                AllowedTags::getWithFormTags()
225
-            );
226
-            ?>
216
+			echo wp_kses(
217
+				EEH_Form_Fields::select(
218
+					esc_html__('Show Dates:', 'event_espresso'),
219
+					$instance['show_dates'],
220
+					$yes_no_values,
221
+					$this->fieldName('show_dates'),
222
+					$this->fieldID('show_dates')
223
+				),
224
+				AllowedTags::getWithFormTags()
225
+			);
226
+			?>
227 227
         </p>
228 228
         <p>
229 229
             <label for="<?php echo esc_attr($this->fieldID('show_everywhere')); ?>">
230 230
                 <?php esc_html_e('Show on all Pages:', 'event_espresso'); ?>
231 231
             </label>
232 232
             <?php
233
-            echo wp_kses(
234
-                EEH_Form_Fields::select(
235
-                    esc_html__('Show on all Pages:', 'event_espresso'),
236
-                    $instance['show_everywhere'],
237
-                    $yes_no_values,
238
-                    $this->fieldName('show_everywhere'),
239
-                    $this->fieldID('show_everywhere')
240
-                ),
241
-                AllowedTags::getWithFormTags()
242
-            );
243
-            ?>
233
+			echo wp_kses(
234
+				EEH_Form_Fields::select(
235
+					esc_html__('Show on all Pages:', 'event_espresso'),
236
+					$instance['show_everywhere'],
237
+					$yes_no_values,
238
+					$this->fieldName('show_everywhere'),
239
+					$this->fieldID('show_everywhere')
240
+				),
241
+				AllowedTags::getWithFormTags()
242
+			);
243
+			?>
244 244
         </p>
245 245
         <p>
246 246
             <label for="<?php echo esc_attr($this->fieldID('date_limit')); ?>">
@@ -258,287 +258,287 @@  discard block
 block discarded – undo
258 258
                 <?php esc_html_e('Show Date Range:', 'event_espresso'); ?>
259 259
             </label>
260 260
             <?php
261
-            echo wp_kses(
262
-                EEH_Form_Fields::select(
263
-                    esc_html__('Show Date Range:', 'event_espresso'),
264
-                    $instance['date_range'],
265
-                    $yes_no_values,
266
-                    $this->fieldName('date_range'),
267
-                    $this->fieldID('date_range')
268
-                ),
269
-                AllowedTags::getWithFormTags()
270
-            );
271
-            ?>
261
+			echo wp_kses(
262
+				EEH_Form_Fields::select(
263
+					esc_html__('Show Date Range:', 'event_espresso'),
264
+					$instance['date_range'],
265
+					$yes_no_values,
266
+					$this->fieldName('date_range'),
267
+					$this->fieldID('date_range')
268
+				),
269
+				AllowedTags::getWithFormTags()
270
+			);
271
+			?>
272 272
             <span class="description">
273 273
                 <br />
274 274
                 <?php esc_html_e(
275
-                    'This setting will replace the list of dates in the widget.',
276
-                    'event_espresso'
277
-                ); ?>
275
+					'This setting will replace the list of dates in the widget.',
276
+					'event_espresso'
277
+				); ?>
278 278
             </span>
279 279
         </p>
280 280
 
281 281
         <?php
282
-    }
283
-
284
-
285
-    /**
286
-     * Sanitize widget form values as they are saved.
287
-     *
288
-     * @param array $new_instance Values just sent to be saved.
289
-     * @param array $old_instance Previously saved values from database.
290
-     *
291
-     * @return array Updated safe values to be saved.
292
-     * @see WP_Widget::update()
293
-     *
294
-     */
295
-    public function update($new_instance, $old_instance)
296
-    {
297
-        $instance                    = $old_instance;
298
-        $instance['title']           = ! empty($new_instance['title']) ? strip_tags((string) $new_instance['title']) : '';
299
-        $instance['category_name']   = $new_instance['category_name'];
300
-        $instance['show_expired']    = $new_instance['show_expired'];
301
-        $instance['limit']           = $new_instance['limit'];
302
-        $instance['sort']            = $new_instance['sort'];
303
-        $instance['image_size']      = $new_instance['image_size'];
304
-        $instance['show_desc']       = $new_instance['show_desc'];
305
-        $instance['show_dates']      = $new_instance['show_dates'];
306
-        $instance['show_everywhere'] = $new_instance['show_everywhere'];
307
-        $instance['date_limit']      = $new_instance['date_limit'];
308
-        $instance['date_range']      = $new_instance['date_range'];
309
-        return $instance;
310
-    }
311
-
312
-
313
-    /**
314
-     * Front-end display of widget.
315
-     *
316
-     * @param array $args     Widget arguments.
317
-     * @param array $instance Saved values from database.
318
-     * @throws EE_Error
319
-     * @throws ReflectionException
320
-     * @see WP_Widget::widget()
321
-     *
322
-     */
323
-    public function widget($args, $instance)
324
-    {
325
-
326
-        global $post;
327
-        // make sure there is some kinda post object
328
-        if ($post instanceof WP_Post) {
329
-            $before_widget = '';
330
-            $before_title  = '';
331
-            $after_title   = '';
332
-            $after_widget  = '';
333
-            // but NOT an events archives page, cuz that would be like two event lists on the same page
334
-            $show_everywhere = ! isset($instance['show_everywhere']) || absint($instance['show_everywhere']);
335
-            if ($show_everywhere || ! ($post->post_type == 'espresso_events' && is_archive())) {
336
-                // let's use some of the event helper functions'
337
-                // make separate vars out of attributes
338
-                extract($args);
339
-
340
-                // grab widget settings
341
-                $this->parseWidgetSettings($instance);
342
-                $title = $this->widgetTitle();
343
-
344
-                // Before widget (defined by themes).
345
-                echo wp_kses($before_widget, AllowedTags::getAllowedTags());
346
-                // Display the widget title if one was input (before and after defined by themes).
347
-                if (! empty($title)) {
348
-                    echo wp_kses($before_title . $title . $after_title, AllowedTags::getAllowedTags());
349
-                }
350
-                echo wp_kses($this->widgetContent($post), AllowedTags::getWithFormTags());
351
-                // After widget (defined by themes).
352
-                echo wp_kses($after_widget, AllowedTags::getAllowedTags());
353
-            }
354
-        }
355
-    }
356
-
357
-
358
-    /**
359
-     * make_the_title_a_link
360
-     * callback for widget_title filter
361
-     *
362
-     * @param $title
363
-     * @return string
364
-     */
365
-    public function make_the_title_a_link($title)
366
-    {
367
-        return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>';
368
-    }
369
-
370
-
371
-    /**
372
-     * @param string $field_name
373
-     * @return string
374
-     * @since   4.10.14.p
375
-     */
376
-    public function fieldID($field_name)
377
-    {
378
-        return parent::get_field_id($field_name);
379
-    }
380
-
381
-
382
-    /**
383
-     * @param string $field_name
384
-     * @return string
385
-     * @since   4.10.14.p
386
-     */
387
-    public function fieldName($field_name)
388
-    {
389
-        return parent::get_field_name($field_name);
390
-    }
391
-
392
-
393
-    /**
394
-     * @param array $instance
395
-     * @throws EE_Error
396
-     * @throws ReflectionException
397
-     * @since   4.10.14.p
398
-     */
399
-    private function eventCategoriesSelector(array $instance)
400
-    {
401
-        $event_categories = [];
402
-        $categories       = EEM_Term::instance()->get_all_ee_categories(true);
403
-        if ($categories) {
404
-            foreach ($categories as $category) {
405
-                if ($category instanceof EE_Term) {
406
-                    $event_categories[] =
407
-                        EE_Question_Option::new_instance(
408
-                            [
409
-                                'QSO_value' => $category->get('slug'),
410
-                                'QSO_desc'  => $category->get('name'),
411
-                            ]
412
-                        );
413
-                }
414
-            }
415
-        }
416
-        array_unshift(
417
-            $event_categories,
418
-            EE_Question_Option::new_instance(
419
-                [
420
-                    'QSO_value' => '',
421
-                    'QSO_desc'  => esc_html__(' - display all - ', 'event_espresso'),
422
-                ]
423
-            )
424
-        );
425
-        echo wp_kses(
426
-            EEH_Form_Fields::select(
427
-                esc_html__('Event Category:', 'event_espresso'),
428
-                $instance['category_name'],
429
-                $event_categories,
430
-                $this->fieldName('category_name'),
431
-                $this->fieldID('category_name')
432
-            ),
433
-            AllowedTags::getWithFormTags()
434
-        );
435
-    }
436
-
437
-
438
-    /**
439
-     * @param array $instance
440
-     * @since   4.10.14.p
441
-     */
442
-    private function imageSizeSelector(array $instance)
443
-    {
444
-        $image_sizes = [];
445
-        $sizes       = get_intermediate_image_sizes();
446
-        if ($sizes) {
447
-            // loop thru images and create option objects out of them
448
-            foreach ($sizes as $image_size) {
449
-                $image_size = trim($image_size);
450
-                // no big images plz
451
-                if (! in_array($image_size, ['large', 'post-thumbnail'])) {
452
-                    $image_sizes[] =
453
-                        EE_Question_Option::new_instance(['QSO_value' => $image_size, 'QSO_desc' => $image_size]);
454
-                }
455
-            }
456
-            $image_sizes[] =
457
-                EE_Question_Option::new_instance(
458
-                    ['QSO_value' => 'none', 'QSO_desc' => esc_html__('don\'t show images', 'event_espresso')]
459
-                );
460
-        }
461
-        echo wp_kses(
462
-            EEH_Form_Fields::select(
463
-                esc_html__('Image Size:', 'event_espresso'),
464
-                $instance['image_size'],
465
-                $image_sizes,
466
-                $this->fieldName('image_size'),
467
-                $this->fieldID('image_size')
468
-            ),
469
-            AllowedTags::getWithFormTags()
470
-        );
471
-    }
472
-
473
-
474
-    /**
475
-     * @param array $instance
476
-     * @since   4.10.14.p
477
-     */
478
-    private function parseWidgetSettings(array $instance)
479
-    {
480
-        $this->title = isset($instance['title']) && ! empty($instance['title']) ? $instance['title'] : '';
481
-        $this->events_category     = isset($instance['category_name']) && ! empty($instance['category_name'])
482
-            ? $instance['category_name']
483
-            : false;
484
-        $this->show_expired = isset($instance['show_expired'])
485
-            ? filter_var($instance['show_expired'], FILTER_VALIDATE_BOOLEAN)
486
-            : 0;
487
-        $this->image_size   = isset($instance['image_size']) && ! empty($instance['image_size'])
488
-            ? $instance['image_size']
489
-            : 'medium';
490
-        $this->show_desc    = ! isset($instance['show_desc'])
491
-                              || filter_var($instance['show_desc'], FILTER_VALIDATE_BOOLEAN);
492
-        $this->show_dates   = ! isset($instance['show_dates'])
493
-                              || filter_var($instance['show_dates'], FILTER_VALIDATE_BOOLEAN);
494
-        $this->date_limit   = isset($instance['date_limit']) && ! empty($instance['date_limit'])
495
-            ? $instance['date_limit']
496
-            : null;
497
-        $this->date_range   = isset($instance['date_range']) && ! empty($instance['date_range'])
498
-            ? $instance['date_range']
499
-            : false;
500
-        $this->limit        = isset($instance['limit']) ? absint($instance['limit']) : 10;
501
-        $this->order        = isset($instance['sort']) && $instance['sort'] === 'DESC'
502
-            ? 'DESC'
503
-            : 'ASC';
504
-    }
505
-
506
-
507
-    /**
508
-     * @return mixed|void
509
-     * @since   4.10.14.p
510
-     */
511
-    private function widgetTitle()
512
-    {
513
-        // add function to make the title a link
514
-        add_filter('widget_title', [$this, 'make_the_title_a_link'], 15);
515
-        // filter the title
516
-        $title = apply_filters('widget_title', $this->title);
517
-        // remove the function from the filter, so it does not affect other widgets
518
-        remove_filter('widget_title', [$this, 'make_the_title_a_link'], 15);
519
-        return $title;
520
-    }
521
-
522
-
523
-    /**
524
-     * @param WP_Post $post
525
-     * @return string
526
-     * @throws EE_Error
527
-     * @throws ReflectionException
528
-     * @since   4.10.14.p
529
-     */
530
-    private function widgetContent(WP_Post $post)
531
-    {
532
-        // run the query
533
-        $events = $this->getUpcomingEvents();
534
-        if (empty($events)) {
535
-            return '';
536
-        }
537
-        $list_items = '';
538
-        foreach ($events as $event) {
539
-            if ($event instanceof EE_Event && (! is_single() || $post->ID != $event->ID())) {
540
-                $event_url = $this->eventUrl($event);
541
-                $list_items .= '
282
+	}
283
+
284
+
285
+	/**
286
+	 * Sanitize widget form values as they are saved.
287
+	 *
288
+	 * @param array $new_instance Values just sent to be saved.
289
+	 * @param array $old_instance Previously saved values from database.
290
+	 *
291
+	 * @return array Updated safe values to be saved.
292
+	 * @see WP_Widget::update()
293
+	 *
294
+	 */
295
+	public function update($new_instance, $old_instance)
296
+	{
297
+		$instance                    = $old_instance;
298
+		$instance['title']           = ! empty($new_instance['title']) ? strip_tags((string) $new_instance['title']) : '';
299
+		$instance['category_name']   = $new_instance['category_name'];
300
+		$instance['show_expired']    = $new_instance['show_expired'];
301
+		$instance['limit']           = $new_instance['limit'];
302
+		$instance['sort']            = $new_instance['sort'];
303
+		$instance['image_size']      = $new_instance['image_size'];
304
+		$instance['show_desc']       = $new_instance['show_desc'];
305
+		$instance['show_dates']      = $new_instance['show_dates'];
306
+		$instance['show_everywhere'] = $new_instance['show_everywhere'];
307
+		$instance['date_limit']      = $new_instance['date_limit'];
308
+		$instance['date_range']      = $new_instance['date_range'];
309
+		return $instance;
310
+	}
311
+
312
+
313
+	/**
314
+	 * Front-end display of widget.
315
+	 *
316
+	 * @param array $args     Widget arguments.
317
+	 * @param array $instance Saved values from database.
318
+	 * @throws EE_Error
319
+	 * @throws ReflectionException
320
+	 * @see WP_Widget::widget()
321
+	 *
322
+	 */
323
+	public function widget($args, $instance)
324
+	{
325
+
326
+		global $post;
327
+		// make sure there is some kinda post object
328
+		if ($post instanceof WP_Post) {
329
+			$before_widget = '';
330
+			$before_title  = '';
331
+			$after_title   = '';
332
+			$after_widget  = '';
333
+			// but NOT an events archives page, cuz that would be like two event lists on the same page
334
+			$show_everywhere = ! isset($instance['show_everywhere']) || absint($instance['show_everywhere']);
335
+			if ($show_everywhere || ! ($post->post_type == 'espresso_events' && is_archive())) {
336
+				// let's use some of the event helper functions'
337
+				// make separate vars out of attributes
338
+				extract($args);
339
+
340
+				// grab widget settings
341
+				$this->parseWidgetSettings($instance);
342
+				$title = $this->widgetTitle();
343
+
344
+				// Before widget (defined by themes).
345
+				echo wp_kses($before_widget, AllowedTags::getAllowedTags());
346
+				// Display the widget title if one was input (before and after defined by themes).
347
+				if (! empty($title)) {
348
+					echo wp_kses($before_title . $title . $after_title, AllowedTags::getAllowedTags());
349
+				}
350
+				echo wp_kses($this->widgetContent($post), AllowedTags::getWithFormTags());
351
+				// After widget (defined by themes).
352
+				echo wp_kses($after_widget, AllowedTags::getAllowedTags());
353
+			}
354
+		}
355
+	}
356
+
357
+
358
+	/**
359
+	 * make_the_title_a_link
360
+	 * callback for widget_title filter
361
+	 *
362
+	 * @param $title
363
+	 * @return string
364
+	 */
365
+	public function make_the_title_a_link($title)
366
+	{
367
+		return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>';
368
+	}
369
+
370
+
371
+	/**
372
+	 * @param string $field_name
373
+	 * @return string
374
+	 * @since   4.10.14.p
375
+	 */
376
+	public function fieldID($field_name)
377
+	{
378
+		return parent::get_field_id($field_name);
379
+	}
380
+
381
+
382
+	/**
383
+	 * @param string $field_name
384
+	 * @return string
385
+	 * @since   4.10.14.p
386
+	 */
387
+	public function fieldName($field_name)
388
+	{
389
+		return parent::get_field_name($field_name);
390
+	}
391
+
392
+
393
+	/**
394
+	 * @param array $instance
395
+	 * @throws EE_Error
396
+	 * @throws ReflectionException
397
+	 * @since   4.10.14.p
398
+	 */
399
+	private function eventCategoriesSelector(array $instance)
400
+	{
401
+		$event_categories = [];
402
+		$categories       = EEM_Term::instance()->get_all_ee_categories(true);
403
+		if ($categories) {
404
+			foreach ($categories as $category) {
405
+				if ($category instanceof EE_Term) {
406
+					$event_categories[] =
407
+						EE_Question_Option::new_instance(
408
+							[
409
+								'QSO_value' => $category->get('slug'),
410
+								'QSO_desc'  => $category->get('name'),
411
+							]
412
+						);
413
+				}
414
+			}
415
+		}
416
+		array_unshift(
417
+			$event_categories,
418
+			EE_Question_Option::new_instance(
419
+				[
420
+					'QSO_value' => '',
421
+					'QSO_desc'  => esc_html__(' - display all - ', 'event_espresso'),
422
+				]
423
+			)
424
+		);
425
+		echo wp_kses(
426
+			EEH_Form_Fields::select(
427
+				esc_html__('Event Category:', 'event_espresso'),
428
+				$instance['category_name'],
429
+				$event_categories,
430
+				$this->fieldName('category_name'),
431
+				$this->fieldID('category_name')
432
+			),
433
+			AllowedTags::getWithFormTags()
434
+		);
435
+	}
436
+
437
+
438
+	/**
439
+	 * @param array $instance
440
+	 * @since   4.10.14.p
441
+	 */
442
+	private function imageSizeSelector(array $instance)
443
+	{
444
+		$image_sizes = [];
445
+		$sizes       = get_intermediate_image_sizes();
446
+		if ($sizes) {
447
+			// loop thru images and create option objects out of them
448
+			foreach ($sizes as $image_size) {
449
+				$image_size = trim($image_size);
450
+				// no big images plz
451
+				if (! in_array($image_size, ['large', 'post-thumbnail'])) {
452
+					$image_sizes[] =
453
+						EE_Question_Option::new_instance(['QSO_value' => $image_size, 'QSO_desc' => $image_size]);
454
+				}
455
+			}
456
+			$image_sizes[] =
457
+				EE_Question_Option::new_instance(
458
+					['QSO_value' => 'none', 'QSO_desc' => esc_html__('don\'t show images', 'event_espresso')]
459
+				);
460
+		}
461
+		echo wp_kses(
462
+			EEH_Form_Fields::select(
463
+				esc_html__('Image Size:', 'event_espresso'),
464
+				$instance['image_size'],
465
+				$image_sizes,
466
+				$this->fieldName('image_size'),
467
+				$this->fieldID('image_size')
468
+			),
469
+			AllowedTags::getWithFormTags()
470
+		);
471
+	}
472
+
473
+
474
+	/**
475
+	 * @param array $instance
476
+	 * @since   4.10.14.p
477
+	 */
478
+	private function parseWidgetSettings(array $instance)
479
+	{
480
+		$this->title = isset($instance['title']) && ! empty($instance['title']) ? $instance['title'] : '';
481
+		$this->events_category     = isset($instance['category_name']) && ! empty($instance['category_name'])
482
+			? $instance['category_name']
483
+			: false;
484
+		$this->show_expired = isset($instance['show_expired'])
485
+			? filter_var($instance['show_expired'], FILTER_VALIDATE_BOOLEAN)
486
+			: 0;
487
+		$this->image_size   = isset($instance['image_size']) && ! empty($instance['image_size'])
488
+			? $instance['image_size']
489
+			: 'medium';
490
+		$this->show_desc    = ! isset($instance['show_desc'])
491
+							  || filter_var($instance['show_desc'], FILTER_VALIDATE_BOOLEAN);
492
+		$this->show_dates   = ! isset($instance['show_dates'])
493
+							  || filter_var($instance['show_dates'], FILTER_VALIDATE_BOOLEAN);
494
+		$this->date_limit   = isset($instance['date_limit']) && ! empty($instance['date_limit'])
495
+			? $instance['date_limit']
496
+			: null;
497
+		$this->date_range   = isset($instance['date_range']) && ! empty($instance['date_range'])
498
+			? $instance['date_range']
499
+			: false;
500
+		$this->limit        = isset($instance['limit']) ? absint($instance['limit']) : 10;
501
+		$this->order        = isset($instance['sort']) && $instance['sort'] === 'DESC'
502
+			? 'DESC'
503
+			: 'ASC';
504
+	}
505
+
506
+
507
+	/**
508
+	 * @return mixed|void
509
+	 * @since   4.10.14.p
510
+	 */
511
+	private function widgetTitle()
512
+	{
513
+		// add function to make the title a link
514
+		add_filter('widget_title', [$this, 'make_the_title_a_link'], 15);
515
+		// filter the title
516
+		$title = apply_filters('widget_title', $this->title);
517
+		// remove the function from the filter, so it does not affect other widgets
518
+		remove_filter('widget_title', [$this, 'make_the_title_a_link'], 15);
519
+		return $title;
520
+	}
521
+
522
+
523
+	/**
524
+	 * @param WP_Post $post
525
+	 * @return string
526
+	 * @throws EE_Error
527
+	 * @throws ReflectionException
528
+	 * @since   4.10.14.p
529
+	 */
530
+	private function widgetContent(WP_Post $post)
531
+	{
532
+		// run the query
533
+		$events = $this->getUpcomingEvents();
534
+		if (empty($events)) {
535
+			return '';
536
+		}
537
+		$list_items = '';
538
+		foreach ($events as $event) {
539
+			if ($event instanceof EE_Event && (! is_single() || $post->ID != $event->ID())) {
540
+				$event_url = $this->eventUrl($event);
541
+				$list_items .= '
542 542
                 <li id="ee-upcoming-events-widget-li-' . absint($event->ID()) . '" 
543 543
                     class="ee-upcoming-events-widget-li"
544 544
                 >
@@ -549,194 +549,194 @@  discard block
 block discarded – undo
549 549
                     </h5>
550 550
                     ' . $this->eventWidgetContent($event, $event_url) . '
551 551
                 </li>';
552
-            }
553
-        }
554
-        return '
552
+			}
553
+		}
554
+		return '
555 555
             <ul class="ee-upcoming-events-widget-ul">
556 556
                 ' . $list_items . '
557 557
             </ul>';
558
-    }
559
-
560
-
561
-    /**
562
-     * @param EE_Event $event
563
-     * @return string|null
564
-     * @throws EE_Error
565
-     * @since   4.10.14.p
566
-     */
567
-    private function eventUrl(EE_Event $event)
568
-    {
569
-        return esc_url_raw(
570
-            apply_filters(
571
-                'FHEE_EEW_Upcoming_Events__widget__event_url',
572
-                $event->get_permalink(),
573
-                $event
574
-            )
575
-        );
576
-    }
577
-
578
-
579
-    /**
580
-     * @return EE_Base_Class[]
581
-     * @throws EE_Error
582
-     */
583
-    private function getUpcomingEvents()
584
-    {
585
-        return EEM_Event::instance()->get_all(
586
-            [
587
-                $this->queryWhereParams(),
588
-                'limit'    => '0,' . $this->limit,
589
-                'order_by' => 'Datetime.DTT_EVT_start',
590
-                'order'    => $this->order,
591
-                'group_by' => 'EVT_ID',
592
-            ]
593
-        );
594
-    }
595
-
596
-
597
-    /**
598
-     * @return mixed|void
599
-     * @throws EE_Error
600
-     * @since   4.10.14.p
601
-     */
602
-    private function queryWhereParams()
603
-    {
604
-        // start to build our where clause
605
-        $where = [
606
-            'status' => ['IN', ['publish', 'sold_out']],
607
-        ];
608
-        // add category
609
-        if ($this->events_category) {
610
-            $where['Term_Taxonomy.taxonomy']  = 'espresso_event_categories';
611
-            $where['Term_Taxonomy.Term.slug'] = $this->events_category;
612
-        }
613
-        // if NOT expired then we want events that start today or in the future
614
-        // if NOT show expired then we want events that start today or in the future
615
-        if ($this->show_expired == 0) {
616
-            $where['Datetime.DTT_EVT_end'] = [
617
-                '>=',
618
-                EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end'),
619
-            ];
620
-        }
621
-        // if show ONLY expired we want events that ended prior to today
622
-        if ($this->show_expired == 2) {
623
-            $where['Datetime.DTT_EVT_end'] = [
624
-                '<=',
625
-                EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start'),
626
-            ];
627
-        }
628
-        // allow $where to be filtered
629
-        return apply_filters('FHEE__EEW_Upcoming_Events__widget__where', $where, $this->events_category, $this->show_expired);
630
-    }
631
-
632
-
633
-    /**
634
-     * @param EE_Event $event
635
-     * @return string
636
-     * @throws EE_Error
637
-     * @throws ReflectionException
638
-     * @since   4.10.14.p
639
-     */
640
-    private function linkClass(EE_Event $event)
641
-    {
642
-        // how big is the event name ?
643
-        $name_length = strlen($event->name());
644
-        switch ($name_length) {
645
-            case $name_length > 70:
646
-                return ' three-line';
647
-            case $name_length > 35:
648
-                return ' two-line';
649
-        }
650
-        return ' one-line';
651
-    }
652
-
653
-
654
-    /**
655
-     * @param EE_Event $event
656
-     * @param string   $event_url
657
-     * @return mixed|string|void
658
-     * @throws EE_Error
659
-     * @throws ReflectionException
660
-     * @since   4.10.14.p
661
-     */
662
-    private function eventWidgetContent(EE_Event $event, $event_url = '')
663
-    {
664
-        if (post_password_required($event->ID())) {
665
-            return apply_filters(
666
-                'FHEE_EEW_Upcoming_Events__widget__password_form',
667
-                get_the_password_form($event->ID()),
668
-                $event
669
-            );
670
-        }
671
-
672
-        $content = '';
673
-        if (has_post_thumbnail($event->ID()) && $this->image_size != 'none') {
674
-            $content .= '
558
+	}
559
+
560
+
561
+	/**
562
+	 * @param EE_Event $event
563
+	 * @return string|null
564
+	 * @throws EE_Error
565
+	 * @since   4.10.14.p
566
+	 */
567
+	private function eventUrl(EE_Event $event)
568
+	{
569
+		return esc_url_raw(
570
+			apply_filters(
571
+				'FHEE_EEW_Upcoming_Events__widget__event_url',
572
+				$event->get_permalink(),
573
+				$event
574
+			)
575
+		);
576
+	}
577
+
578
+
579
+	/**
580
+	 * @return EE_Base_Class[]
581
+	 * @throws EE_Error
582
+	 */
583
+	private function getUpcomingEvents()
584
+	{
585
+		return EEM_Event::instance()->get_all(
586
+			[
587
+				$this->queryWhereParams(),
588
+				'limit'    => '0,' . $this->limit,
589
+				'order_by' => 'Datetime.DTT_EVT_start',
590
+				'order'    => $this->order,
591
+				'group_by' => 'EVT_ID',
592
+			]
593
+		);
594
+	}
595
+
596
+
597
+	/**
598
+	 * @return mixed|void
599
+	 * @throws EE_Error
600
+	 * @since   4.10.14.p
601
+	 */
602
+	private function queryWhereParams()
603
+	{
604
+		// start to build our where clause
605
+		$where = [
606
+			'status' => ['IN', ['publish', 'sold_out']],
607
+		];
608
+		// add category
609
+		if ($this->events_category) {
610
+			$where['Term_Taxonomy.taxonomy']  = 'espresso_event_categories';
611
+			$where['Term_Taxonomy.Term.slug'] = $this->events_category;
612
+		}
613
+		// if NOT expired then we want events that start today or in the future
614
+		// if NOT show expired then we want events that start today or in the future
615
+		if ($this->show_expired == 0) {
616
+			$where['Datetime.DTT_EVT_end'] = [
617
+				'>=',
618
+				EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end'),
619
+			];
620
+		}
621
+		// if show ONLY expired we want events that ended prior to today
622
+		if ($this->show_expired == 2) {
623
+			$where['Datetime.DTT_EVT_end'] = [
624
+				'<=',
625
+				EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start'),
626
+			];
627
+		}
628
+		// allow $where to be filtered
629
+		return apply_filters('FHEE__EEW_Upcoming_Events__widget__where', $where, $this->events_category, $this->show_expired);
630
+	}
631
+
632
+
633
+	/**
634
+	 * @param EE_Event $event
635
+	 * @return string
636
+	 * @throws EE_Error
637
+	 * @throws ReflectionException
638
+	 * @since   4.10.14.p
639
+	 */
640
+	private function linkClass(EE_Event $event)
641
+	{
642
+		// how big is the event name ?
643
+		$name_length = strlen($event->name());
644
+		switch ($name_length) {
645
+			case $name_length > 70:
646
+				return ' three-line';
647
+			case $name_length > 35:
648
+				return ' two-line';
649
+		}
650
+		return ' one-line';
651
+	}
652
+
653
+
654
+	/**
655
+	 * @param EE_Event $event
656
+	 * @param string   $event_url
657
+	 * @return mixed|string|void
658
+	 * @throws EE_Error
659
+	 * @throws ReflectionException
660
+	 * @since   4.10.14.p
661
+	 */
662
+	private function eventWidgetContent(EE_Event $event, $event_url = '')
663
+	{
664
+		if (post_password_required($event->ID())) {
665
+			return apply_filters(
666
+				'FHEE_EEW_Upcoming_Events__widget__password_form',
667
+				get_the_password_form($event->ID()),
668
+				$event
669
+			);
670
+		}
671
+
672
+		$content = '';
673
+		if (has_post_thumbnail($event->ID()) && $this->image_size != 'none') {
674
+			$content .= '
675 675
                 <div class="ee-upcoming-events-widget-img-dv">
676 676
                     <a class="ee-upcoming-events-widget-img" href="' . $event_url . '">
677 677
                         ' . get_the_post_thumbnail($event->ID(), $this->image_size) . '
678 678
                     </a>
679 679
                 </div>';
680
-        }
681
-
682
-        if ($this->show_dates) {
683
-            $content .= $this->eventDates($event);
684
-        }
685
-
686
-        if ($this->show_desc) {
687
-            $allowedtags = AllowedTags::getAllowedTags();
688
-            $desc    = $event->short_description(25);
689
-            $content .= $desc ? '<p style="margin-top: .5em">' . wp_kses($desc, $allowedtags) . '</p>' : '';
690
-        }
691
-
692
-        return $content;
693
-    }
694
-
695
-
696
-    /**
697
-     * @param EE_Event $event
698
-     * @return string
699
-     * @throws EE_Error
700
-     * @throws ReflectionException
701
-     * @since   4.10.14.p
702
-     */
703
-    private function eventDates(EE_Event $event)
704
-    {
705
-        $date_format        = apply_filters(
706
-            'FHEE__espresso_event_date_range__date_format',
707
-            get_option('date_format')
708
-        );
709
-        $time_format        = apply_filters(
710
-            'FHEE__espresso_event_date_range__time_format',
711
-            get_option('time_format')
712
-        );
713
-        $single_date_format = apply_filters(
714
-            'FHEE__espresso_event_date_range__single_date_format',
715
-            get_option('date_format')
716
-        );
717
-        $single_time_format = apply_filters(
718
-            'FHEE__espresso_event_date_range__single_time_format',
719
-            get_option('time_format')
720
-        );
721
-        if ($this->date_range == true) {
722
-            return espresso_event_date_range(
723
-                $date_format,
724
-                $time_format,
725
-                $single_date_format,
726
-                $single_time_format,
727
-                $event->ID(),
728
-                false
729
-            );
730
-        }
731
-        return espresso_list_of_event_dates(
732
-            $event->ID(),
733
-            $date_format,
734
-            $time_format,
735
-            false,
736
-            null,
737
-            true,
738
-            true,
739
-            $this->date_limit
740
-        );
741
-    }
680
+		}
681
+
682
+		if ($this->show_dates) {
683
+			$content .= $this->eventDates($event);
684
+		}
685
+
686
+		if ($this->show_desc) {
687
+			$allowedtags = AllowedTags::getAllowedTags();
688
+			$desc    = $event->short_description(25);
689
+			$content .= $desc ? '<p style="margin-top: .5em">' . wp_kses($desc, $allowedtags) . '</p>' : '';
690
+		}
691
+
692
+		return $content;
693
+	}
694
+
695
+
696
+	/**
697
+	 * @param EE_Event $event
698
+	 * @return string
699
+	 * @throws EE_Error
700
+	 * @throws ReflectionException
701
+	 * @since   4.10.14.p
702
+	 */
703
+	private function eventDates(EE_Event $event)
704
+	{
705
+		$date_format        = apply_filters(
706
+			'FHEE__espresso_event_date_range__date_format',
707
+			get_option('date_format')
708
+		);
709
+		$time_format        = apply_filters(
710
+			'FHEE__espresso_event_date_range__time_format',
711
+			get_option('time_format')
712
+		);
713
+		$single_date_format = apply_filters(
714
+			'FHEE__espresso_event_date_range__single_date_format',
715
+			get_option('date_format')
716
+		);
717
+		$single_time_format = apply_filters(
718
+			'FHEE__espresso_event_date_range__single_time_format',
719
+			get_option('time_format')
720
+		);
721
+		if ($this->date_range == true) {
722
+			return espresso_event_date_range(
723
+				$date_format,
724
+				$time_format,
725
+				$single_date_format,
726
+				$single_time_format,
727
+				$event->ID(),
728
+				false
729
+			);
730
+		}
731
+		return espresso_list_of_event_dates(
732
+			$event->ID(),
733
+			$date_format,
734
+			$time_format,
735
+			false,
736
+			null,
737
+			true,
738
+			true,
739
+			$this->date_limit
740
+		);
741
+	}
742 742
 }
Please login to merge, or discard this patch.
admin/new/pricing/templates/pricing_details_main_meta_box.template.php 2 patches
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -15,48 +15,48 @@  discard block
 block discarded – undo
15 15
         <tbody>
16 16
         <tr valign="top">
17 17
             <th><label for="PRT_ID"><?php
18
-                esc_html_e(
19
-                    'Type',
20
-                    'event_espresso'
21
-                ); ?></label> <?php echo wp_kses(EEH_Template::get_help_tab_link('type_field_info'), AllowedTags::getAllowedTags()); ?></th>
18
+				esc_html_e(
19
+					'Type',
20
+					'event_espresso'
21
+				); ?></label> <?php echo wp_kses(EEH_Template::get_help_tab_link('type_field_info'), AllowedTags::getAllowedTags()); ?></th>
22 22
             <td>
23 23
                 <?php if ($price->type_obj() && $price->type_obj()->base_type() === 1) : ?>
24 24
                     <input type="hidden" name="PRT_ID" id="PRT_ID" value="<?php echo esc_attr($price->type()); ?>"/>
25 25
                     <p><strong><?php esc_html_e('Price', 'event_espresso'); ?></strong></p>
26 26
                     <p class="description">
27 27
                         <?php
28
-                        esc_html_e(
29
-                            'This is the default base price. Every new ticket created will start off with this base price.',
30
-                            'event_espresso'
31
-                        );
32
-                        ?>
28
+						esc_html_e(
29
+							'This is the default base price. Every new ticket created will start off with this base price.',
30
+							'event_espresso'
31
+						);
32
+						?>
33 33
                     </p>
34 34
                 <?php else : ?>
35 35
                     <?php echo wp_kses(
36
-                        EEH_Form_Fields::select_input(
37
-                            'PRT_ID',
38
-                            $price_types,
39
-                            $price->type(),
40
-                            'id="PRT_ID"'
41
-                        ),
42
-                        AllowedTags::getWithFormTags()
43
-                    ); ?>
36
+						EEH_Form_Fields::select_input(
37
+							'PRT_ID',
38
+							$price_types,
39
+							$price->type(),
40
+							'id="PRT_ID"'
41
+						),
42
+						AllowedTags::getWithFormTags()
43
+					); ?>
44 44
                     <p class="description">
45 45
                         <?php
46
-                            esc_html_e(
47
-                                'Price Modifier. Default items will apply to ALL new events you create.',
48
-                                'event_espresso'
49
-                            );
50
-                        ?></p>
46
+							esc_html_e(
47
+								'Price Modifier. Default items will apply to ALL new events you create.',
48
+								'event_espresso'
49
+							);
50
+						?></p>
51 51
                 <?php endif; ?>
52 52
             </td>
53 53
         </tr>
54 54
         <tr valign="top">
55 55
             <th><label for="PRC_name"><?php
56
-                    esc_html_e(
57
-                        'Name',
58
-                        'event_espresso'
59
-                    ); ?></label> <?php echo wp_kses(EEH_Template::get_help_tab_link('name_field_info'), AllowedTags::getAllowedTags()); ?></th>
56
+					esc_html_e(
57
+						'Name',
58
+						'event_espresso'
59
+					); ?></label> <?php echo wp_kses(EEH_Template::get_help_tab_link('name_field_info'), AllowedTags::getAllowedTags()); ?></th>
60 60
             <td>
61 61
                 <input class="regular-text" type="text" id="PRC_name" name="PRC_name"
62 62
                        value="<?php $price->f('PRC_name'); ?>"/>
@@ -64,22 +64,22 @@  discard block
 block discarded – undo
64 64
         </tr>
65 65
         <tr valign="top">
66 66
             <th><label for="PRC_desc"><?php
67
-                    esc_html_e(
68
-                        'Description',
69
-                        'event_espresso'
70
-                    ); ?></label> <?php echo wp_kses(EEH_Template::get_help_tab_link('description_field_info'), AllowedTags::getAllowedTags()); ?></th>
67
+					esc_html_e(
68
+						'Description',
69
+						'event_espresso'
70
+					); ?></label> <?php echo wp_kses(EEH_Template::get_help_tab_link('description_field_info'), AllowedTags::getAllowedTags()); ?></th>
71 71
             <td>
72 72
                     <textarea class="regular-text" id="PRC_desc" name="PRC_desc" rows="5"><?php
73
-                        echo esc_textarea($price->get_f('PRC_desc'));
74
-                    ?></textarea><br/>
73
+						echo esc_textarea($price->get_f('PRC_desc'));
74
+					?></textarea><br/>
75 75
             </td>
76 76
         </tr>
77 77
         <tr valign="top">
78 78
             <th><label for="PRC_amount"><?php
79
-                    esc_html_e(
80
-                        'Amount',
81
-                        'event_espresso'
82
-                    ); ?><?php echo wp_kses(EEH_Template::get_help_tab_link('amount_field_info'), AllowedTags::getAllowedTags()); ?></label></th>
79
+					esc_html_e(
80
+						'Amount',
81
+						'event_espresso'
82
+					); ?><?php echo wp_kses(EEH_Template::get_help_tab_link('amount_field_info'), AllowedTags::getAllowedTags()); ?></label></th>
83 83
             <td>
84 84
                 <input class="small-text ee-numeric" type="text" id="PRC_amount" name="PRC_amount"
85 85
                        value="<?php echo esc_attr($price->amount()); ?>"/>
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@  discard block
 block discarded – undo
31 31
                         );
32 32
                         ?>
33 33
                     </p>
34
-                <?php else : ?>
34
+                <?php else {
35
+	: ?>
35 36
                     <?php echo wp_kses(
36 37
                         EEH_Form_Fields::select_input(
37 38
                             'PRT_ID',
@@ -40,7 +41,9 @@  discard block
 block discarded – undo
40 41
                             'id="PRT_ID"'
41 42
                         ),
42 43
                         AllowedTags::getWithFormTags()
43
-                    ); ?>
44
+                    );
45
+}
46
+?>
44 47
                     <p class="description">
45 48
                         <?php
46 49
                             esc_html_e(
Please login to merge, or discard this patch.
registration_form/templates/question_groups_main_meta_box.template.php 1 patch
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 /* @var EE_Question[] $all_questions */
16 16
 assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions)));// list of unused questions
17 17
 foreach ($all_questions as $unused_question) {
18
-    assert($unused_question);
19
-    assert($unused_question instanceof EE_Question);
18
+	assert($unused_question);
19
+	assert($unused_question instanceof EE_Question);
20 20
 }
21 21
 /* @var array $values . Array of arrays, where each sub-array contains 2 keys: 'id' (internal value) and 'name' (label for displaying) */
22 22
 assert(is_array($values));
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
             <td>
101 101
                 <label for="QSG_show_group_name">
102 102
                     <?php echo wp_kses(
103
-                        EEH_Form_Fields::select_input(
104
-                            'QSG_show_group_name',
105
-                            $values,
106
-                            $question_group->show_group_name()
107
-                        ),
108
-                        AllowedTags::getWithFormTags()
109
-                    ); ?>
103
+						EEH_Form_Fields::select_input(
104
+							'QSG_show_group_name',
105
+							$values,
106
+							$question_group->show_group_name()
107
+						),
108
+						AllowedTags::getWithFormTags()
109
+					); ?>
110 110
                     <p class="description"><?php esc_html_e('Show Group Name on Registration Page?', 'event_espresso'); ?></p>
111 111
                 </label>
112 112
             </td>
@@ -122,16 +122,16 @@  discard block
 block discarded – undo
122 122
             <td>
123 123
                 <label for="QSG_show_group_order">
124 124
                     <?php echo wp_kses(
125
-                        EEH_Form_Fields::select_input(
126
-                            'QSG_show_group_desc',
127
-                            $values,
128
-                            $question_group->show_group_desc()
129
-                        ),
130
-                        AllowedTags::getWithFormTags()
131
-                    ); ?>
125
+						EEH_Form_Fields::select_input(
126
+							'QSG_show_group_desc',
127
+							$values,
128
+							$question_group->show_group_desc()
129
+						),
130
+						AllowedTags::getWithFormTags()
131
+					); ?>
132 132
                     <p class="description"><?php
133
-                        esc_html_e(' Show Group Description on Registration Page?', 'event_espresso');
134
-                    ?></p>
133
+						esc_html_e(' Show Group Description on Registration Page?', 'event_espresso');
134
+					?></p>
135 135
                 </label>
136 136
                 <input type="hidden" name="QSG_system" value="<?php echo esc_attr($question_group->system_group()); ?>">
137 137
             </td>
@@ -147,85 +147,85 @@  discard block
 block discarded – undo
147 147
     <div class="form-table question-group-questions inside">
148 148
         <div class="padding">
149 149
             <p><span class="description"><?php
150
-                    esc_html_e(
151
-                        'Select which questions should be shown in this group by checking or unchecking boxes. You can drag and drop questions to reorder them. Your changes will be updated when you save.',
152
-                        'event_espresso'
153
-                    ); ?></span></p>
150
+					esc_html_e(
151
+						'Select which questions should be shown in this group by checking or unchecking boxes. You can drag and drop questions to reorder them. Your changes will be updated when you save.',
152
+						'event_espresso'
153
+					); ?></span></p>
154 154
             <div>
155 155
                 <ul class="question-list-sortable">
156 156
                     <?php
157
-                    $question_order = 0;
158
-                    $question_group_questions = $question_group->questions();
159
-                    foreach ($all_questions as $question_ID => $question) {
160
-                        if ($question instanceof EE_Question) {
161
-                            /*@var $question EE_Question*/
162
-                            $checked = isset($question_group_questions[ $question_ID ]) ? 'checked' : '';
163
-                            // disable questions from the personal information question group
164
-                            // is it required in the current question group? if so don't allow admins to remove it
165
-                            $disabled = in_array(
166
-                                $question->system_ID(),
167
-                                EEM_Question::instance()->required_system_questions_in_system_question_group(
168
-                                    $QSG_system
169
-                                )
170
-                            ) ? 'disabled' : '';
171
-                            // limit where system questions can appear
172
-                            if (
173
-                                $question->system_ID() &&
174
-                                ! in_array(
175
-                                    $question->system_ID(),
176
-                                    EEM_Question::instance()->allowed_system_questions_in_system_question_group(
177
-                                        $QSG_system
178
-                                    )
179
-                                )
180
-                            ) {
181
-                                continue; // skip over system question not assigned to this group except for the address system group cause we want the address questions to display even if they aren't selected (but still not show the personal system questions).  The third condition checks if we're displaying a non system question group and the question is a system question, then we skip because for non-system question groups we only want to show non-system questions.
182
-                            }
183
-                            ?>
157
+					$question_order = 0;
158
+					$question_group_questions = $question_group->questions();
159
+					foreach ($all_questions as $question_ID => $question) {
160
+						if ($question instanceof EE_Question) {
161
+							/*@var $question EE_Question*/
162
+							$checked = isset($question_group_questions[ $question_ID ]) ? 'checked' : '';
163
+							// disable questions from the personal information question group
164
+							// is it required in the current question group? if so don't allow admins to remove it
165
+							$disabled = in_array(
166
+								$question->system_ID(),
167
+								EEM_Question::instance()->required_system_questions_in_system_question_group(
168
+									$QSG_system
169
+								)
170
+							) ? 'disabled' : '';
171
+							// limit where system questions can appear
172
+							if (
173
+								$question->system_ID() &&
174
+								! in_array(
175
+									$question->system_ID(),
176
+									EEM_Question::instance()->allowed_system_questions_in_system_question_group(
177
+										$QSG_system
178
+									)
179
+								)
180
+							) {
181
+								continue; // skip over system question not assigned to this group except for the address system group cause we want the address questions to display even if they aren't selected (but still not show the personal system questions).  The third condition checks if we're displaying a non system question group and the question is a system question, then we skip because for non-system question groups we only want to show non-system questions.
182
+							}
183
+							?>
184 184
                             <li class="ee-question-sortable">
185 185
                                 <label for="question-<?php echo absint($question_ID); ?>">
186 186
                                     <input type="checkbox" name="questions[<?php echo absint($question_ID); ?>]"
187 187
                                            id="question-<?php echo absint($question_ID); ?>"
188 188
                                            value="<?php echo absint($question_ID); ?>" <?php echo esc_attr($disabled); ?> <?php echo esc_attr($checked); ?>>
189 189
                                     <span class="question-text"><?php
190
-                                        echo wp_kses(trim($question->display_text()), AllowedTags::getAllowedTags())
191
-                                             . (95 <= strlen(trim($question->display_text()))
192
-                                                ? "&hellip;"
193
-                                                : '');
194
-                                                                ?>
190
+										echo wp_kses(trim($question->display_text()), AllowedTags::getAllowedTags())
191
+											 . (95 <= strlen(trim($question->display_text()))
192
+												? "&hellip;"
193
+												: '');
194
+																?>
195 195
                                     </span>
196 196
                                     <input class="question-group-QGQ_order" type="hidden"
197 197
                                            name="question_orders[<?php echo absint($question_ID); ?>]"
198 198
                                            value="<?php echo esc_attr($question_order); ?>">
199 199
                                 </label>
200 200
                                 <?php
201
-                                if (
202
-                                    EE_Registry::instance()->CAP->current_user_can(
203
-                                        'ee_edit_question',
204
-                                        'espresso_registration_form_edit_question',
205
-                                        $question->ID()
206
-                                    )
207
-                                ) {
208
-                                    $edit_query_args = array(
209
-                                        'action' => 'edit_question',
210
-                                        'QST_ID' => $question->ID(),
211
-                                    );
212
-                                    $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
213
-
214
-                                    echo '<a href="' . $edit_link . '" target="_blank" aria-label="' .
215
-                                        sprintf(
216
-                                            esc_attr__('Edit %s', 'event_espresso'),
217
-                                            $question->admin_label()
218
-                                        )
219
-                                        . '"><span class="dashicons dashicons-edit"></span>
201
+								if (
202
+									EE_Registry::instance()->CAP->current_user_can(
203
+										'ee_edit_question',
204
+										'espresso_registration_form_edit_question',
205
+										$question->ID()
206
+									)
207
+								) {
208
+									$edit_query_args = array(
209
+										'action' => 'edit_question',
210
+										'QST_ID' => $question->ID(),
211
+									);
212
+									$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
213
+
214
+									echo '<a href="' . $edit_link . '" target="_blank" aria-label="' .
215
+										sprintf(
216
+											esc_attr__('Edit %s', 'event_espresso'),
217
+											$question->admin_label()
218
+										)
219
+										. '"><span class="dashicons dashicons-edit"></span>
220 220
                                         </a>';
221
-                                }
222
-                                ?>
221
+								}
222
+								?>
223 223
                             </li>
224 224
                             <?php
225
-                            $question_order++;
226
-                        }
227
-                    }
228
-                    ?>
225
+							$question_order++;
226
+						}
227
+					}
228
+					?>
229 229
                 </ul>
230 230
             </div>
231 231
         </div>
Please login to merge, or discard this patch.
admin/extend/general_settings/templates/debug_log_settings.template.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@
 block discarded – undo
21 21
         </th>
22 22
         <td>
23 23
             <?php echo wp_kses(
24
-                EEH_Form_Fields::select_input(
25
-                    'use_remote_logging',
26
-                    $values,
27
-                    $use_remote_logging
28
-                ),
29
-                AllowedTags::getWithFormTags()
30
-            ); ?>
24
+				EEH_Form_Fields::select_input(
25
+					'use_remote_logging',
26
+					$values,
27
+					$use_remote_logging
28
+				),
29
+				AllowedTags::getWithFormTags()
30
+			); ?>
31 31
             <p class="description">
32 32
                 <?php esc_html_e('Send debugging data to the remote URL below.', 'event_espresso'); ?>
33 33
             </p>
Please login to merge, or discard this patch.
event_single_caff/templates/admin-event-single-settings.template.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@  discard block
 block discarded – undo
4 4
 
5 5
 add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string');
6 6
 $values = EEH_Form_Fields::prep_answer_options(
7
-    array(
8
-        array('id' => 1, 'text' => esc_html__('Yes', 'event_espresso')),
9
-        array('id' => 0, 'text' => esc_html__('No', 'event_espresso')),
10
-    )
7
+	array(
8
+		array('id' => 1, 'text' => esc_html__('Yes', 'event_espresso')),
9
+		array('id' => 0, 'text' => esc_html__('No', 'event_espresso')),
10
+	)
11 11
 );
12 12
 ?>
13 13
 
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 
16 16
 <h2 class="ee-admin-settings-hdr">
17 17
     <?php esc_html_e(
18
-        'Single Event Pages',
19
-        'event_espresso'
20
-    ); ?><?php // echo wp_kses(EEH_Template::get_help_tab_link('event_single_settings_info'),AllowedTags::getAllowedTags()); ?>
18
+		'Single Event Pages',
19
+		'event_espresso'
20
+	); ?><?php // echo wp_kses(EEH_Template::get_help_tab_link('event_single_settings_info'),AllowedTags::getAllowedTags()); ?>
21 21
 </h2>
22 22
 <table class="form-table">
23 23
     <tbody>
@@ -29,20 +29,20 @@  discard block
 block discarded – undo
29 29
         </th>
30 30
         <td>
31 31
             <?php echo wp_kses(
32
-                EEH_Form_Fields::select(
33
-                    'display_status_banner_single',
34
-                    $display_status_banner_single,
35
-                    $values,
36
-                    'display_status_banner_single',
37
-                    'display_status_banner_single'
38
-                ),
39
-                AllowedTags::getWithFormTags()
40
-            ); ?>
32
+				EEH_Form_Fields::select(
33
+					'display_status_banner_single',
34
+					$display_status_banner_single,
35
+					$values,
36
+					'display_status_banner_single',
37
+					'display_status_banner_single'
38
+				),
39
+				AllowedTags::getWithFormTags()
40
+			); ?>
41 41
             <p class="description"><?php
42
-                esc_html_e(
43
-                    'Selecting "Yes" will inject an Event Status banner with the title whenever Events are displaying on the single event page.',
44
-                    'event_espresso'
45
-                ); ?></p>
42
+				esc_html_e(
43
+					'Selecting "Yes" will inject an Event Status banner with the title whenever Events are displaying on the single event page.',
44
+					'event_espresso'
45
+				); ?></p>
46 46
         </td>
47 47
     </tr>
48 48
 
@@ -55,20 +55,20 @@  discard block
 block discarded – undo
55 55
         </th>
56 56
         <td>
57 57
             <?php echo wp_kses(
58
-                EEH_Form_Fields::select(
59
-                    'display_venue',
60
-                    $display_venue,
61
-                    $values,
62
-                    'display_venue',
63
-                    'display_venue'
64
-                ),
65
-                AllowedTags::getWithFormTags()
66
-            ); ?>
58
+				EEH_Form_Fields::select(
59
+					'display_venue',
60
+					$display_venue,
61
+					$values,
62
+					'display_venue',
63
+					'display_venue'
64
+				),
65
+				AllowedTags::getWithFormTags()
66
+			); ?>
67 67
             <p class="description"><?php
68
-                esc_html_e(
69
-                    'Do not use this if you are using the venue shortcodes in your event description.',
70
-                    'event_espresso'
71
-                ); ?></p>
68
+				esc_html_e(
69
+					'Do not use this if you are using the venue shortcodes in your event description.',
70
+					'event_espresso'
71
+				); ?></p>
72 72
         </td>
73 73
     </tr>
74 74
 
@@ -80,17 +80,17 @@  discard block
 block discarded – undo
80 80
         </th>
81 81
         <td>
82 82
             <?php
83
-            echo wp_kses(
84
-                EEH_Form_Fields::select(
85
-                    'use_sortable_display_order',
86
-                    $use_sortable_display_order,
87
-                    $values,
88
-                    'EED_Events_Single_use_sortable_display_order',
89
-                    'EED_Events_Single_use_sortable_display_order'
90
-                ),
91
-                AllowedTags::getWithFormTags()
92
-            );
93
-            ?>
83
+			echo wp_kses(
84
+				EEH_Form_Fields::select(
85
+					'use_sortable_display_order',
86
+					$use_sortable_display_order,
87
+					$values,
88
+					'EED_Events_Single_use_sortable_display_order',
89
+					'EED_Events_Single_use_sortable_display_order'
90
+				),
91
+				AllowedTags::getWithFormTags()
92
+			);
93
+			?>
94 94
         </td>
95 95
     </tr>
96 96
 
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
         <td>
103 103
 
104 104
             <?php wp_nonce_field(
105
-                'espresso_update_event_single_order',
106
-                'espresso_update_event_single_order_nonce',
107
-                false
108
-            ); ?>
105
+				'espresso_update_event_single_order',
106
+				'espresso_update_event_single_order_nonce',
107
+				false
108
+			); ?>
109 109
             <?php echo wp_kses($event_single_display_order, AllowedTags::getWithFormTags()); ?>
110 110
 
111 111
             <p class="description"><?php
112
-                esc_html_e(
113
-                    'Drag and Drop the above to determine the display order of the Event Description, Date and Times, Ticket Selector, and Venue Information on the single event page.',
114
-                    'event_espresso'
115
-                ); ?></p>
112
+				esc_html_e(
113
+					'Drag and Drop the above to determine the display order of the Event Description, Date and Times, Ticket Selector, and Venue Information on the single event page.',
114
+					'event_espresso'
115
+				); ?></p>
116 116
 
117 117
         </td>
118 118
     </tr>
Please login to merge, or discard this patch.
events_archive_caff/templates/admin-event-list-settings.template.php 1 patch
Indentation   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -5,18 +5,18 @@  discard block
 block discarded – undo
5 5
 add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string');
6 6
 
7 7
 $values = EEH_Form_Fields::prep_answer_options(
8
-    array(
9
-        array('id' => 1, 'text' => esc_html__('Yes', 'event_espresso')),
10
-        array('id' => 0, 'text' => esc_html__('No', 'event_espresso')),
11
-    )
8
+	array(
9
+		array('id' => 1, 'text' => esc_html__('Yes', 'event_espresso')),
10
+		array('id' => 0, 'text' => esc_html__('No', 'event_espresso')),
11
+	)
12 12
 );
13 13
 
14 14
 $description = EEH_Form_Fields::prep_answer_options(
15
-    array(
16
-        array('id' => 0, 'text' => esc_html__('none', 'event_espresso')),
17
-        array('id' => 1, 'text' => esc_html__('excerpt (short desc)', 'event_espresso')),
18
-        array('id' => 2, 'text' => esc_html__('full description', 'event_espresso')),
19
-    )
15
+	array(
16
+		array('id' => 0, 'text' => esc_html__('none', 'event_espresso')),
17
+		array('id' => 1, 'text' => esc_html__('excerpt (short desc)', 'event_espresso')),
18
+		array('id' => 2, 'text' => esc_html__('full description', 'event_espresso')),
19
+	)
20 20
 );
21 21
 
22 22
 ?>
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         <td>
42 42
             <a id="event_listings_url" class="ee-admin-settings-hdr-lnk small-text"
43 43
                href="<?php echo EEH_Event_View::event_archive_url(); ?>"><?php
44
-                echo EEH_Event_View::event_archive_url(); ?></a>
44
+				echo EEH_Event_View::event_archive_url(); ?></a>
45 45
         </td>
46 46
     </tr>
47 47
 
@@ -53,30 +53,30 @@  discard block
 block discarded – undo
53 53
         </th>
54 54
         <td>
55 55
             <p><?php echo site_url() . '/ '
56
-                          . EEH_Form_Fields::text(
57
-                              'not_used',
58
-                              EE_Registry::instance()->CFG->core->event_cpt_slug,
59
-                              'event_cpt_slug',
60
-                              'event_cpt_slug',
61
-                              'regular'
62
-                          ); ?></p>
56
+						  . EEH_Form_Fields::text(
57
+							  'not_used',
58
+							  EE_Registry::instance()->CFG->core->event_cpt_slug,
59
+							  'event_cpt_slug',
60
+							  'event_cpt_slug',
61
+							  'regular'
62
+						  ); ?></p>
63 63
             <p class="description"><?php
64
-                esc_html_e(
65
-                    'This allows you to configure what slug is used for the url of all event pages.',
66
-                    'event_espresso'
67
-                ); ?></p>
64
+				esc_html_e(
65
+					'This allows you to configure what slug is used for the url of all event pages.',
66
+					'event_espresso'
67
+				); ?></p>
68 68
             <?php if (has_filter('FHEE__EE_Register_CPTs__register_CPT__rewrite')) : ?>
69 69
                 <p class="important-notice">
70 70
                     <?php
71
-                    sprintf(
72
-                        esc_html__(
73
-                            'Usage of the %1$s FHEE__EE_Register_CPTs__register_CPT__rewrite %2$s filter has been detected.  Please be aware that while this filter is being used, this setting has no affect.',
74
-                            'event_espresso'
75
-                        ),
76
-                        '<code>',
77
-                        '</code>'
78
-                    );
79
-                    ?>
71
+					sprintf(
72
+						esc_html__(
73
+							'Usage of the %1$s FHEE__EE_Register_CPTs__register_CPT__rewrite %2$s filter has been detected.  Please be aware that while this filter is being used, this setting has no affect.',
74
+							'event_espresso'
75
+						),
76
+						'<code>',
77
+						'</code>'
78
+					);
79
+					?>
80 80
                 </p>
81 81
             <?php endif; ?>
82 82
         </td>
@@ -90,20 +90,20 @@  discard block
 block discarded – undo
90 90
         </th>
91 91
         <td>
92 92
             <?php echo wp_kses(
93
-                EEH_Form_Fields::select(
94
-                    'display_status_banner',
95
-                    $display_status_banner,
96
-                    $values,
97
-                    'EED_Events_Archive_display_status_banner',
98
-                    'EED_Events_Archive_display_status_banner'
99
-                ),
100
-                AllowedTags::getWithFormTags()
101
-            ); ?>
93
+				EEH_Form_Fields::select(
94
+					'display_status_banner',
95
+					$display_status_banner,
96
+					$values,
97
+					'EED_Events_Archive_display_status_banner',
98
+					'EED_Events_Archive_display_status_banner'
99
+				),
100
+				AllowedTags::getWithFormTags()
101
+			); ?>
102 102
             <p class="description"><?php
103
-                esc_html_e(
104
-                    'Selecting "Yes" will inject an Event Status banner with the title whenever Events are displaying on the events archive page.',
105
-                    'event_espresso'
106
-                ); ?></p>
103
+				esc_html_e(
104
+					'Selecting "Yes" will inject an Event Status banner with the title whenever Events are displaying on the events archive page.',
105
+					'event_espresso'
106
+				); ?></p>
107 107
         </td>
108 108
     </tr>
109 109
 
@@ -116,15 +116,15 @@  discard block
 block discarded – undo
116 116
         </th>
117 117
         <td>
118 118
             <?php echo wp_kses(
119
-                EEH_Form_Fields::select(
120
-                    'description',
121
-                    $display_description,
122
-                    $description,
123
-                    'EED_Events_Archive_display_description',
124
-                    'EED_Events_Archive_display_description'
125
-                ),
126
-                AllowedTags::getWithFormTags()
127
-            ); ?>
119
+				EEH_Form_Fields::select(
120
+					'description',
121
+					$display_description,
122
+					$description,
123
+					'EED_Events_Archive_display_description',
124
+					'EED_Events_Archive_display_description'
125
+				),
126
+				AllowedTags::getWithFormTags()
127
+			); ?>
128 128
         </td>
129 129
     </tr>
130 130
 
@@ -137,15 +137,15 @@  discard block
 block discarded – undo
137 137
         </th>
138 138
         <td>
139 139
             <?php echo wp_kses(
140
-                EEH_Form_Fields::select(
141
-                    'ticket_selector',
142
-                    $display_ticket_selector,
143
-                    $values,
144
-                    'EED_Events_Archive_display_ticket_selector',
145
-                    'EED_Events_Archive_display_ticket_selector'
146
-                ),
147
-                AllowedTags::getWithFormTags()
148
-            ); ?>
140
+				EEH_Form_Fields::select(
141
+					'ticket_selector',
142
+					$display_ticket_selector,
143
+					$values,
144
+					'EED_Events_Archive_display_ticket_selector',
145
+					'EED_Events_Archive_display_ticket_selector'
146
+				),
147
+				AllowedTags::getWithFormTags()
148
+			); ?>
149 149
         </td>
150 150
     </tr>
151 151
 
@@ -158,15 +158,15 @@  discard block
 block discarded – undo
158 158
         </th>
159 159
         <td>
160 160
             <?php echo wp_kses(
161
-                EEH_Form_Fields::select(
162
-                    'venue_details',
163
-                    $display_datetimes,
164
-                    $values,
165
-                    'EED_Events_Archive_display_datetimes',
166
-                    'EED_Events_Archive_display_datetimes'
167
-                ),
168
-                AllowedTags::getWithFormTags()
169
-            ); ?>
161
+				EEH_Form_Fields::select(
162
+					'venue_details',
163
+					$display_datetimes,
164
+					$values,
165
+					'EED_Events_Archive_display_datetimes',
166
+					'EED_Events_Archive_display_datetimes'
167
+				),
168
+				AllowedTags::getWithFormTags()
169
+			); ?>
170 170
         </td>
171 171
     </tr>
172 172
 
@@ -179,15 +179,15 @@  discard block
 block discarded – undo
179 179
         </th>
180 180
         <td>
181 181
             <?php echo wp_kses(
182
-                EEH_Form_Fields::select(
183
-                    'display_venue',
184
-                    $display_venue,
185
-                    $values,
186
-                    'EED_Events_Archive_display_venue',
187
-                    'EED_Events_Archive_display_venue'
188
-                ),
189
-                AllowedTags::getWithFormTags()
190
-            ); ?>
182
+				EEH_Form_Fields::select(
183
+					'display_venue',
184
+					$display_venue,
185
+					$values,
186
+					'EED_Events_Archive_display_venue',
187
+					'EED_Events_Archive_display_venue'
188
+				),
189
+				AllowedTags::getWithFormTags()
190
+			); ?>
191 191
         </td>
192 192
     </tr>
193 193
 
@@ -200,15 +200,15 @@  discard block
 block discarded – undo
200 200
         </th>
201 201
         <td>
202 202
             <?php echo wp_kses(
203
-                EEH_Form_Fields::select(
204
-                    'expired_events',
205
-                    $display_expired_events,
206
-                    $values,
207
-                    'EED_Events_Archive_display_expired_events',
208
-                    'EED_Events_Archive_display_expired_events'
209
-                ),
210
-                AllowedTags::getWithFormTags()
211
-            ); ?>
203
+				EEH_Form_Fields::select(
204
+					'expired_events',
205
+					$display_expired_events,
206
+					$values,
207
+					'EED_Events_Archive_display_expired_events',
208
+					'EED_Events_Archive_display_expired_events'
209
+				),
210
+				AllowedTags::getWithFormTags()
211
+			); ?>
212 212
         </td>
213 213
     </tr>
214 214
 
@@ -216,46 +216,46 @@  discard block
 block discarded – undo
216 216
         <th>
217 217
             <label for="EED_Events_Archive_use_sortable_display_order">
218 218
                 <?php esc_html_e(
219
-                    'Use Custom Display Order?',
220
-                    'event_espresso'
221
-                ); ?><?php // echo wp_kses(EEH_Template::get_help_tab_link('use_sortable_display_order_info'),AllowedTags::getAllowedTags()); ?>
219
+					'Use Custom Display Order?',
220
+					'event_espresso'
221
+				); ?><?php // echo wp_kses(EEH_Template::get_help_tab_link('use_sortable_display_order_info'),AllowedTags::getAllowedTags()); ?>
222 222
             </label>
223 223
         </th>
224 224
         <td>
225 225
             <?php echo wp_kses(
226
-                EEH_Form_Fields::select(
227
-                    'use_sortable_display_order',
228
-                    $use_sortable_display_order,
229
-                    $values,
230
-                    'EED_Events_Archive_use_sortable_display_order',
231
-                    'EED_Events_Archive_use_sortable_display_order'
232
-                ),
233
-                AllowedTags::getWithFormTags()
234
-            ); ?>
226
+				EEH_Form_Fields::select(
227
+					'use_sortable_display_order',
228
+					$use_sortable_display_order,
229
+					$values,
230
+					'EED_Events_Archive_use_sortable_display_order',
231
+					'EED_Events_Archive_use_sortable_display_order'
232
+				),
233
+				AllowedTags::getWithFormTags()
234
+			); ?>
235 235
         </td>
236 236
     </tr>
237 237
 
238 238
     <tr>
239 239
         <th>
240 240
             <?php esc_html_e(
241
-                'Display Order',
242
-                'event_espresso'
243
-            ); ?><?php // echo wp_kses(EEH_Template::get_help_tab_link('event_archive_order_info'),AllowedTags::getAllowedTags()); ?>
241
+				'Display Order',
242
+				'event_espresso'
243
+			); ?><?php // echo wp_kses(EEH_Template::get_help_tab_link('event_archive_order_info'),AllowedTags::getAllowedTags()); ?>
244 244
         </th>
245 245
         <td>
246 246
 
247 247
             <?php wp_nonce_field(
248
-                'espresso_update_event_archive_order',
249
-                'espresso_update_event_archive_order_nonce',
250
-                false
251
-            ); ?>
248
+				'espresso_update_event_archive_order',
249
+				'espresso_update_event_archive_order_nonce',
250
+				false
251
+			); ?>
252 252
             <?php echo wp_kses($event_archive_display_order, AllowedTags::getWithFormTags()); ?>
253 253
 
254 254
             <p class="description"><?php
255
-                esc_html_e(
256
-                    'Drag and Drop the above to determine the display order of the Event Description, Date and Times, Ticket Selector, and Venue Information on the event archive page.',
257
-                    'event_espresso'
258
-                ); ?></p>
255
+				esc_html_e(
256
+					'Drag and Drop the above to determine the display order of the Event Description, Date and Times, Ticket Selector, and Venue Information on the event archive page.',
257
+					'event_espresso'
258
+				); ?></p>
259 259
 
260 260
         </td>
261 261
     </tr>
@@ -268,15 +268,15 @@  discard block
 block discarded – undo
268 268
         </th>
269 269
         <td>
270 270
             <?php echo wp_kses(
271
-                EEH_Form_Fields::select(
272
-                    'reset_event_list_settings',
273
-                    0,
274
-                    $values,
275
-                    'EED_Events_Archive_reset_event_list_settings',
276
-                    'EED_Events_Archive_reset_event_list_settings'
277
-                ),
278
-                AllowedTags::getWithFormTags()
279
-            ); ?>
271
+				EEH_Form_Fields::select(
272
+					'reset_event_list_settings',
273
+					0,
274
+					$values,
275
+					'EED_Events_Archive_reset_event_list_settings',
276
+					'EED_Events_Archive_reset_event_list_settings'
277
+				),
278
+				AllowedTags::getWithFormTags()
279
+			); ?>
280 280
         </td>
281 281
     </tr>
282 282
 
Please login to merge, or discard this patch.