@@ -180,6 +180,7 @@ Asserts that a string does not match a given regular expression.
180
180
181
181
#### assertEmpty
182
182
183
+ * ` phpstan-assert ` empty $actual
183
184
* ` param mixed ` $actual
184
185
* ` param string ` $message
185
186
@@ -225,6 +226,7 @@ Asserts that two variables are equal (with delta).
225
226
226
227
#### assertFalse
227
228
229
+ * ` phpstan-assert ` false $condition
228
230
* ` param mixed ` $condition
229
231
* ` param string ` $message
230
232
@@ -386,7 +388,9 @@ Asserts that a variable is infinite.
386
388
387
389
#### assertInstanceOf
388
390
389
- * ` param string ` $expected
391
+ * ` template ` ExpectedType of object
392
+ * ` phpstan-assert ` =ExpectedType $actual
393
+ * ` param class-string<ExpectedType> ` $expected
390
394
* ` param mixed ` $actual
391
395
* ` param string ` $message
392
396
@@ -395,6 +399,7 @@ Asserts that a variable is of a given type.
395
399
396
400
#### assertIsArray
397
401
402
+ * ` phpstan-assert ` array $actual
398
403
* ` param mixed ` $actual
399
404
* ` param string ` $message
400
405
@@ -403,6 +408,7 @@ Asserts that a variable is of type array.
403
408
404
409
#### assertIsBool
405
410
411
+ * ` phpstan-assert ` bool $actual
406
412
* ` param mixed ` $actual
407
413
* ` param string ` $message
408
414
@@ -411,6 +417,7 @@ Asserts that a variable is of type bool.
411
417
412
418
#### assertIsCallable
413
419
420
+ * ` phpstan-assert ` callable $actual
414
421
* ` param mixed ` $actual
415
422
* ` param string ` $message
416
423
@@ -419,6 +426,7 @@ Asserts that a variable is of type callable.
419
426
420
427
#### assertIsClosedResource
421
428
429
+ * ` phpstan-assert ` resource $actual
422
430
* ` param mixed ` $actual
423
431
* ` param string ` $message
424
432
@@ -435,6 +443,7 @@ Asserts that a variable is empty.
435
443
436
444
#### assertIsFloat
437
445
446
+ * ` phpstan-assert ` float $actual
438
447
* ` param mixed ` $actual
439
448
* ` param string ` $message
440
449
@@ -443,6 +452,7 @@ Asserts that a variable is of type float.
443
452
444
453
#### assertIsInt
445
454
455
+ * ` phpstan-assert ` int $actual
446
456
* ` param mixed ` $actual
447
457
* ` param string ` $message
448
458
@@ -451,6 +461,7 @@ Asserts that a variable is of type int.
451
461
452
462
#### assertIsIterable
453
463
464
+ * ` phpstan-assert ` iterable $actual
454
465
* ` param mixed ` $actual
455
466
* ` param string ` $message
456
467
@@ -459,6 +470,7 @@ Asserts that a variable is of type iterable.
459
470
460
471
#### assertIsNotArray
461
472
473
+ * ` phpstan-assert ` !array $actual
462
474
* ` param mixed ` $actual
463
475
* ` param string ` $message
464
476
@@ -467,6 +479,7 @@ Asserts that a variable is not of type array.
467
479
468
480
#### assertIsNotBool
469
481
482
+ * ` phpstan-assert ` !bool $actual
470
483
* ` param mixed ` $actual
471
484
* ` param string ` $message
472
485
@@ -475,6 +488,7 @@ Asserts that a variable is not of type bool.
475
488
476
489
#### assertIsNotCallable
477
490
491
+ * ` phpstan-assert ` !callable $actual
478
492
* ` param mixed ` $actual
479
493
* ` param string ` $message
480
494
@@ -483,6 +497,7 @@ Asserts that a variable is not of type callable.
483
497
484
498
#### assertIsNotClosedResource
485
499
500
+ * ` phpstan-assert ` !resource $actual
486
501
* ` param mixed ` $actual
487
502
* ` param string ` $message
488
503
@@ -491,6 +506,7 @@ Asserts that a variable is not of type resource.
491
506
492
507
#### assertIsNotFloat
493
508
509
+ * ` phpstan-assert ` !float $actual
494
510
* ` param mixed ` $actual
495
511
* ` param string ` $message
496
512
@@ -499,6 +515,7 @@ Asserts that a variable is not of type float.
499
515
500
516
#### assertIsNotInt
501
517
518
+ * ` phpstan-assert ` !int $actual
502
519
* ` param mixed ` $actual
503
520
* ` param string ` $message
504
521
@@ -507,6 +524,7 @@ Asserts that a variable is not of type int.
507
524
508
525
#### assertIsNotIterable
509
526
527
+ * ` phpstan-assert ` !iterable $actual
510
528
* ` param mixed ` $actual
511
529
* ` param string ` $message
512
530
@@ -515,6 +533,7 @@ Asserts that a variable is not of type iterable.
515
533
516
534
#### assertIsNotNumeric
517
535
536
+ * ` phpstan-assert ` !numeric $actual
518
537
* ` param mixed ` $actual
519
538
* ` param string ` $message
520
539
@@ -523,6 +542,7 @@ Asserts that a variable is not of type numeric.
523
542
524
543
#### assertIsNotObject
525
544
545
+ * ` phpstan-assert ` !object $actual
526
546
* ` param mixed ` $actual
527
547
* ` param string ` $message
528
548
@@ -539,6 +559,7 @@ Asserts that a file/dir exists and is not readable.
539
559
540
560
#### assertIsNotResource
541
561
562
+ * ` phpstan-assert ` !resource $actual
542
563
* ` param mixed ` $actual
543
564
* ` param string ` $message
544
565
@@ -547,6 +568,7 @@ Asserts that a variable is not of type resource.
547
568
548
569
#### assertIsNotScalar
549
570
571
+ * ` psalm-assert ` !scalar $actual
550
572
* ` param mixed ` $actual
551
573
* ` param string ` $message
552
574
@@ -555,6 +577,7 @@ Asserts that a variable is not of type scalar.
555
577
556
578
#### assertIsNotString
557
579
580
+ * ` phpstan-assert ` !string $actual
558
581
* ` param mixed ` $actual
559
582
* ` param string ` $message
560
583
@@ -571,6 +594,7 @@ Asserts that a file/dir exists and is not writable.
571
594
572
595
#### assertIsNumeric
573
596
597
+ * ` phpstan-assert ` numeric $actual
574
598
* ` param mixed ` $actual
575
599
* ` param string ` $message
576
600
@@ -579,6 +603,7 @@ Asserts that a variable is of type numeric.
579
603
580
604
#### assertIsObject
581
605
606
+ * ` phpstan-assert ` object $actual
582
607
* ` param mixed ` $actual
583
608
* ` param string ` $message
584
609
@@ -595,6 +620,7 @@ Asserts that a file/dir is readable.
595
620
596
621
#### assertIsResource
597
622
623
+ * ` phpstan-assert ` resource $actual
598
624
* ` param mixed ` $actual
599
625
* ` param string ` $message
600
626
@@ -603,6 +629,7 @@ Asserts that a variable is of type resource.
603
629
604
630
#### assertIsScalar
605
631
632
+ * ` phpstan-assert ` scalar $actual
606
633
* ` param mixed ` $actual
607
634
* ` param string ` $message
608
635
@@ -611,6 +638,7 @@ Asserts that a variable is of type scalar.
611
638
612
639
#### assertIsString
613
640
641
+ * ` phpstan-assert ` string $actual
614
642
* ` param mixed ` $actual
615
643
* ` param string ` $message
616
644
@@ -768,6 +796,7 @@ Asserts the number of elements of an array, Countable or Traversable.
768
796
769
797
#### assertNotEmpty
770
798
799
+ * ` phpstan-assert ` !empty $actual
771
800
* ` param mixed ` $actual
772
801
* ` param string ` $message
773
802
@@ -813,6 +842,7 @@ Asserts that two variables are not equal (with delta).
813
842
814
843
#### assertNotFalse
815
844
845
+ * ` phpstan-assert ` !false $condition
816
846
* ` param mixed ` $condition
817
847
* ` param string ` $message
818
848
@@ -821,7 +851,9 @@ Asserts that a condition is not false.
821
851
822
852
#### assertNotInstanceOf
823
853
824
- * ` param string ` $expected
854
+ * ` template ` ExpectedType of object
855
+ * ` phpstan-assert ` !ExpectedType $actual
856
+ * ` param class-string<ExpectedType> ` $expected
825
857
* ` param mixed ` $actual
826
858
* ` param string ` $message
827
859
@@ -830,6 +862,7 @@ Asserts that a variable is not of a given type.
830
862
831
863
#### assertNotNull
832
864
865
+ * ` phpstan-assert ` !null $actual
833
866
* ` param mixed ` $actual
834
867
* ` param string ` $message
835
868
@@ -865,6 +898,7 @@ Assert that the size of two arrays (or `Countable` or `Traversable` objects) is
865
898
866
899
#### assertNotTrue
867
900
901
+ * ` phpstan-assert ` !true $condition
868
902
* ` param mixed ` $condition
869
903
* ` param string ` $message
870
904
@@ -873,6 +907,7 @@ Asserts that a condition is not true.
873
907
874
908
#### assertNull
875
909
910
+ * ` phpstan-assert ` null $actual
876
911
* ` param mixed ` $actual
877
912
* ` param string ` $message
878
913
@@ -908,12 +943,17 @@ Asserts that a string matches a given regular expression.
908
943
909
944
#### assertSame
910
945
911
- * ` param mixed ` $expected
946
+ * ` template ` ExpectedType
947
+ * ` phpstan-assert ` =ExpectedType $actual
948
+ * ` param ExpectedType ` $expected
912
949
* ` param mixed ` $actual
913
950
* ` param string ` $message
914
951
915
952
Asserts that two variables have the same type and value.
916
953
954
+ Used on objects, it asserts that two variables reference
955
+ the same object.
956
+
917
957
918
958
#### assertSameSize
919
959
@@ -1098,6 +1138,7 @@ Evaluates a PHPUnit\Framework\Constraint matcher object.
1098
1138
1099
1139
#### assertTrue
1100
1140
1141
+ * ` phpstan-assert ` true $condition
1101
1142
* ` param mixed ` $condition
1102
1143
* ` param string ` $message
1103
1144
0 commit comments