@@ -708,12 +708,14 @@ public static function dataDescribe(): array
708
708
'int|string ' ,
709
709
'int|string ' ,
710
710
'int|string ' ,
711
+ 'int|string ' ,
711
712
],
712
713
[
713
714
new UnionType ([new IntegerType (), new StringType (), new NullType ()]),
714
715
'int|string|null ' ,
715
716
'int|string|null ' ,
716
717
'int|string|null ' ,
718
+ 'int|string|null ' ,
717
719
],
718
720
[
719
721
new UnionType ([
@@ -735,6 +737,7 @@ public static function dataDescribe(): array
735
737
]),
736
738
"1|2|2.2|10|'1'|'10'|'10aaa'|'11aaa'|'1aaa'|'2'|'2aaa'|'foo'|stdClass|true|null " ,
737
739
"1|2|2.2|10|'1'|'10'|'10aaa'|'11aaa'|'1aaa'|'2'|'2aaa'|'foo'|stdClass|true|null " ,
740
+ "1|2|2.2|10|'1'|'10'|'10aaa'|'11aaa'|'1aaa'|'2'|'2aaa'|'foo'|stdClass|true|null " ,
738
741
'float|int|stdClass|string|true|null ' ,
739
742
],
740
743
[
@@ -757,6 +760,7 @@ public static function dataDescribe(): array
757
760
),
758
761
'\'aaa \'|array{a: int, b: float}|array{a: string, b: bool} ' ,
759
762
'\'aaa \'|array{a: int, b: float}|array{a: string, b: bool} ' ,
763
+ '\'aaa \'|array{a: int, b: float}|array{a: string, b: bool} ' ,
760
764
'array<string, bool|float|int|string>|string ' ,
761
765
],
762
766
[
@@ -779,6 +783,7 @@ public static function dataDescribe(): array
779
783
),
780
784
'\'aaa \'|array{a: string, b: bool}|array{b: int, c: float} ' ,
781
785
'\'aaa \'|array{a: string, b: bool}|array{b: int, c: float} ' ,
786
+ '\'aaa \'|array{a: string, b: bool}|array{b: int, c: float} ' ,
782
787
'array<string, bool|float|int|string>|string ' ,
783
788
],
784
789
[
@@ -801,6 +806,7 @@ public static function dataDescribe(): array
801
806
),
802
807
'\'aaa \'|array{a: string, b: bool}|array{c: int, d: float} ' ,
803
808
'\'aaa \'|array{a: string, b: bool}|array{c: int, d: float} ' ,
809
+ '\'aaa \'|array{a: string, b: bool}|array{c: int, d: float} ' ,
804
810
'array<string, bool|float|int|string>|string ' ,
805
811
],
806
812
[
@@ -822,6 +828,7 @@ public static function dataDescribe(): array
822
828
),
823
829
'array{int, bool, float}|array{string} ' ,
824
830
'array{int, bool, float}|array{string} ' ,
831
+ 'array{int, bool, float}|array{string} ' ,
825
832
'array<int, bool|float|int|string> ' ,
826
833
],
827
834
[
@@ -835,6 +842,7 @@ public static function dataDescribe(): array
835
842
),
836
843
'array{}|array{foooo: \'barrr \'} ' ,
837
844
'array{}|array{foooo: \'barrr \'} ' ,
845
+ 'array{}|array{foooo: \'barrr \'} ' ,
838
846
'array<string, string> ' ,
839
847
],
840
848
[
@@ -847,6 +855,7 @@ public static function dataDescribe(): array
847
855
),
848
856
'int|numeric-string ' ,
849
857
'int|numeric-string ' ,
858
+ 'int|numeric-string ' ,
850
859
'int|string ' ,
851
860
],
852
861
[
@@ -857,6 +866,7 @@ public static function dataDescribe(): array
857
866
'int<0, 4>|int<6, 10> ' ,
858
867
'int<0, 4>|int<6, 10> ' ,
859
868
'int<0, 4>|int<6, 10> ' ,
869
+ 'int<0, 4>|int<6, 10> ' ,
860
870
],
861
871
[
862
872
TypeCombinator::union (
@@ -869,6 +879,7 @@ public static function dataDescribe(): array
869
879
new NullType (),
870
880
),
871
881
'TFoo of int (class foo, parameter)|null ' ,
882
+ 'TFoo of int (class foo, parameter)|null ' ,
872
883
'(TFoo of int)|null ' ,
873
884
'(TFoo of int)|null ' ,
874
885
],
@@ -883,6 +894,7 @@ public static function dataDescribe(): array
883
894
new GenericClassStringType (new ObjectType ('Abc ' )),
884
895
),
885
896
'class-string<Abc>|TFoo of int (class foo, parameter) ' ,
897
+ 'class-string<Abc>|TFoo of int (class foo, parameter) ' ,
886
898
'class-string<Abc>|TFoo of int ' ,
887
899
'class-string<Abc>|TFoo of int ' ,
888
900
],
@@ -897,6 +909,7 @@ public static function dataDescribe(): array
897
909
new NullType (),
898
910
),
899
911
'TFoo (class foo, parameter)|null ' ,
912
+ 'TFoo (class foo, parameter)|null ' ,
900
913
'TFoo|null ' ,
901
914
'TFoo|null ' ,
902
915
],
@@ -916,12 +929,14 @@ public static function dataDescribe(): array
916
929
new NullType (),
917
930
),
918
931
'TFoo of TBar (class foo, parameter) (class foo, parameter)|null ' ,
932
+ 'TFoo of TBar (class foo, parameter) (class foo, parameter)|null ' ,
919
933
'(TFoo of TBar)|null ' ,
920
934
'(TFoo of TBar)|null ' ,
921
935
],
922
936
[
923
937
new UnionType ([new ObjectType ('Foo ' ), new ObjectType ('Foo ' )]),
924
938
'Foo#1|Foo#2 ' ,
939
+ 'Foo#1|Foo#2 ' ,
925
940
'Foo ' ,
926
941
'Foo ' ,
927
942
],
@@ -931,11 +946,13 @@ public static function dataDescribe(): array
931
946
#[DataProvider('dataDescribe ' )]
932
947
public function testDescribe (
933
948
Type $ type ,
949
+ string $ expectedCacheDescription ,
934
950
string $ expectedPreciseDescription ,
935
951
string $ expectedValueDescription ,
936
952
string $ expectedTypeOnlyDescription ,
937
953
): void
938
954
{
955
+ $ this ->assertSame ($ expectedPreciseDescription , $ type ->describe (VerbosityLevel::cache ()));
939
956
$ this ->assertSame ($ expectedPreciseDescription , $ type ->describe (VerbosityLevel::precise ()));
940
957
$ this ->assertSame ($ expectedValueDescription , $ type ->describe (VerbosityLevel::value ()));
941
958
$ this ->assertSame ($ expectedTypeOnlyDescription , $ type ->describe (VerbosityLevel::typeOnly ()));
0 commit comments