4646class TypeSpecifierTest extends PHPStanTestCase
4747{
4848
49- private const FALSEY_TYPE_DESCRIPTION = '0|0.0| \'\'| \'0 \'|array{}|false|null ' ;
49+ private const FALSEY_TYPE_DESCRIPTION = '0|-0.0| 0.0| \'\'| \'0 \'|array{}|false|null ' ;
5050 private const TRUTHY_TYPE_DESCRIPTION = 'mixed~( ' . self ::FALSEY_TYPE_DESCRIPTION . ') ' ;
5151 private const SURE_NOT_FALSEY = '~ ' . self ::FALSEY_TYPE_DESCRIPTION ;
5252 private const SURE_NOT_TRUTHY = '~ ' . self ::TRUTHY_TYPE_DESCRIPTION ;
@@ -481,8 +481,8 @@ public static function dataCondition(): iterable
481481 new Variable ('foo ' ),
482482 new Expr \ConstFetch (new Name ('null ' )),
483483 ),
484- ['$foo ' => '0|0.0| \'\'|array{}|false|null ' ],
485- ['$foo ' => '~0|0.0| \'\'|array{}|false|null ' ],
484+ ['$foo ' => '0|-0.0| 0.0| \'\'|array{}|false|null ' ],
485+ ['$foo ' => '~0|-0.0| 0.0| \'\'|array{}|false|null ' ],
486486 ],
487487 [
488488 new Expr \BinaryOp \Identical (
@@ -633,7 +633,7 @@ public static function dataCondition(): iterable
633633 [
634634 new Expr \BooleanNot (new Expr \Empty_ (new Variable ('stringOrNull ' ))),
635635 [
636- '$stringOrNull ' => '~0|0.0| \'\'| \'0 \'|array{}|false|null ' ,
636+ '$stringOrNull ' => '~0|-0.0| 0.0| \'\'| \'0 \'|array{}|false|null ' ,
637637 ],
638638 [
639639 '$stringOrNull ' => '\'\'| \'0 \'|null ' ,
@@ -655,13 +655,13 @@ public static function dataCondition(): iterable
655655 '$array ' => 'array{}|null ' ,
656656 ],
657657 [
658- '$array ' => '~0|0.0| \'\'| \'0 \'|array{}|false|null ' ,
658+ '$array ' => '~0|-0.0| 0.0| \'\'| \'0 \'|array{}|false|null ' ,
659659 ],
660660 ],
661661 [
662662 new BooleanNot (new Expr \Empty_ (new Variable ('array ' ))),
663663 [
664- '$array ' => '~0|0.0| \'\'| \'0 \'|array{}|false|null ' ,
664+ '$array ' => '~0|-0.0| 0.0| \'\'| \'0 \'|array{}|false|null ' ,
665665 ],
666666 [
667667 '$array ' => 'array{}|null ' ,
@@ -826,7 +826,7 @@ public static function dataCondition(): iterable
826826 '$n ' => 'mixed~(int<3, max>|true) ' ,
827827 ],
828828 [
829- '$n ' => 'mixed~(0.0|int<min, 2>|false|null) ' ,
829+ '$n ' => 'mixed~(-0.0| 0.0|int<min, 2>|false|null) ' ,
830830 ],
831831 ],
832832 [
@@ -838,7 +838,7 @@ public static function dataCondition(): iterable
838838 '$n ' => 'mixed~(int< ' . PHP_INT_MIN . ', max>|true) ' ,
839839 ],
840840 [
841- '$n ' => 'mixed~(0.0|false|null) ' ,
841+ '$n ' => 'mixed~(-0.0| 0.0|false|null) ' ,
842842 ],
843843 ],
844844 [
@@ -847,7 +847,7 @@ public static function dataCondition(): iterable
847847 new LNumber (PHP_INT_MAX ),
848848 ),
849849 [
850- '$n ' => 'mixed~(0.0|bool|int<min, ' . PHP_INT_MAX . '>|null) ' ,
850+ '$n ' => 'mixed~(-0.0| 0.0|bool|int<min, ' . PHP_INT_MAX . '>|null) ' ,
851851 ],
852852 [
853853 '$n ' => 'mixed ' ,
@@ -862,7 +862,7 @@ public static function dataCondition(): iterable
862862 '$n ' => 'mixed~int< ' . (PHP_INT_MIN + 1 ) . ', max> ' ,
863863 ],
864864 [
865- '$n ' => 'mixed~(0.0|bool|int<min, ' . PHP_INT_MIN . '>|null) ' ,
865+ '$n ' => 'mixed~(-0.0| 0.0|bool|int<min, ' . PHP_INT_MIN . '>|null) ' ,
866866 ],
867867 ],
868868 [
@@ -871,7 +871,7 @@ public static function dataCondition(): iterable
871871 new LNumber (PHP_INT_MAX ),
872872 ),
873873 [
874- '$n ' => 'mixed~(0.0|int<min, ' . (PHP_INT_MAX - 1 ) . '>|false|null) ' ,
874+ '$n ' => 'mixed~(-0.0| 0.0|int<min, ' . (PHP_INT_MAX - 1 ) . '>|false|null) ' ,
875875 ],
876876 [
877877 '$n ' => 'mixed~(int< ' . PHP_INT_MAX . ', max>|true) ' ,
@@ -889,7 +889,7 @@ public static function dataCondition(): iterable
889889 ),
890890 ),
891891 [
892- '$n ' => 'mixed~(0.0|int<min, 2>|int<6, max>|false|null) ' ,
892+ '$n ' => 'mixed~(-0.0| 0.0|int<min, 2>|int<6, max>|false|null) ' ,
893893 ],
894894 [
895895 '$n ' => 'mixed~(int<3, 5>|true) ' ,
@@ -1252,7 +1252,7 @@ public static function dataCondition(): iterable
12521252 ),
12531253 [
12541254 '$foo ' => 'non-empty-array<mixed, mixed> ' ,
1255- 'count($foo) ' => 'mixed~(0.0|int<min, 1>|false|null) ' ,
1255+ 'count($foo) ' => 'mixed~(-0.0| 0.0|int<min, 1>|false|null) ' ,
12561256 ],
12571257 [],
12581258 ],
0 commit comments