@@ -12,82 +12,146 @@ function mixed_function(): mixed {
12
12
// Inspector::assertAll()
13
13
$ callable = fn (string $ value ): bool => $ value === 'foo ' ;
14
14
$ input = mixed_function ();
15
- assert (Inspector::assertAll ($ callable , $ input ));
16
- assertType ("iterable " , $ input );
15
+ if (Inspector::assertAll ($ callable , $ input )) {
16
+ assertType ("iterable " , $ input );
17
+ }
18
+ else {
19
+ assertType ('mixed ' , $ input );
20
+ }
17
21
18
22
$ input = mixed_function ();
19
23
$ callable = is_string (...);
20
- assert (Inspector::assertAll ($ callable , $ input ));
21
- assertType ('iterable ' , $ input );
24
+ if (Inspector::assertAll ($ callable , $ input )) {
25
+ assertType ('iterable ' , $ input );
26
+ }
27
+ else {
28
+ assertType ('mixed ' , $ input );
29
+ }
22
30
23
31
24
32
// Inspector::assertAllStrings()
25
33
$ input = mixed_function ();
26
- assert (Inspector::assertAllStrings ($ input ));
27
- assertType ('iterable<string> ' , $ input );
34
+ if (Inspector::assertAllStrings ($ input )) {
35
+ assertType ('iterable<string> ' , $ input );
36
+ }
37
+ else {
38
+ assertType ('mixed~iterable<string> ' , $ input );
39
+ }
28
40
29
41
// Inspector::assertAllStringable()
30
42
$ input = mixed_function ();
31
- assert (Inspector::assertAllStringable ($ input ));
32
- assertType ('iterable<string|Stringable> ' , $ input );
43
+ if (Inspector::assertAllStringable ($ input )) {
44
+ assertType ('iterable<string|Stringable> ' , $ input );
45
+ }
46
+ else {
47
+ assertType ('mixed~iterable<string|Stringable> ' , $ input );
48
+ }
33
49
34
50
// Inspector::assertAllArrays()
35
51
$ input = mixed_function ();
36
- \assert (Inspector::assertAllArrays ($ input ));
37
- assertType ('iterable<array> ' , $ input );
52
+ if (Inspector::assertAllArrays ($ input )) {
53
+ assertType ('iterable<array> ' , $ input );
54
+ }
55
+ else {
56
+ assertType ('mixed~iterable<array> ' , $ input );
57
+ }
38
58
39
59
// Inspector::assertStrictArray()
40
60
$ input = mixed_function ();
41
- assert (Inspector::assertStrictArray ($ input ));
42
- assertType ('array<int<0, max>, mixed> ' , $ input );
61
+ if (Inspector::assertStrictArray ($ input )) {
62
+ assertType ('array<int<0, max>, mixed> ' , $ input );
63
+ }
64
+ else {
65
+ assertType ('mixed~array<int<0, max>, mixed> ' , $ input );
66
+ }
43
67
44
68
// Inspector::assertAllStrictArrays()
45
69
$ input = mixed_function ();
46
- assert (Inspector::assertAllStrictArrays ($ input ));
47
- assertType ('iterable<array<int<0, max>, mixed>> ' , $ input );
70
+ if (Inspector::assertAllStrictArrays ($ input )) {
71
+ assertType ('iterable<array<int<0, max>, mixed>> ' , $ input );
72
+ }
73
+ else {
74
+ assertType ('mixed~iterable<array<int<0, max>, mixed>> ' , $ input );
75
+ }
48
76
49
77
// Inspector::assertAllHaveKey()
50
78
$ input = mixed_function ();
51
- assert (Inspector::assertAllHaveKey ($ input , 'foo ' , 'baz ' ));
52
- assertType ("iterable<array&hasOffset('baz')&hasOffset('foo')> " , $ input );
79
+ if (Inspector::assertAllHaveKey ($ input , 'foo ' , 'baz ' )) {
80
+ assertType ("iterable<array&hasOffset('baz')&hasOffset('foo')> " , $ input );
81
+ }
82
+ else {
83
+ assertType ("mixed~iterable<array&hasOffset('baz')&hasOffset('foo')> " , $ input );
84
+ }
53
85
54
86
// Inspector::assertAllIntegers()
55
87
$ input = mixed_function ();
56
- assert (Inspector::assertAllIntegers ($ input ));
57
- assertType ('iterable<int> ' , $ input );
88
+ if (Inspector::assertAllIntegers ($ input )) {
89
+ assertType ('iterable<int> ' , $ input );
90
+ }
91
+ else {
92
+ assertType ('mixed~iterable<int> ' , $ input );
93
+ }
58
94
59
95
// Inspector::assertAllFloat()
60
96
$ input = mixed_function ();
61
- assert (Inspector::assertAllFloat ($ input ));
62
- assertType ('iterable<float> ' , $ input );
97
+ if (Inspector::assertAllFloat ($ input )) {
98
+ assertType ('iterable<float> ' , $ input );
99
+ }
100
+ else {
101
+ assertType ('mixed~iterable<float> ' , $ input );
102
+ }
63
103
64
104
// Inspector::assertAllCallable()
65
105
$ input = mixed_function ();
66
- assert (Inspector::assertAllCallable ($ input ));
67
- assertType ('iterable<callable(): mixed> ' , $ input );
106
+ if (Inspector::assertAllCallable ($ input )) {
107
+ assertType ('iterable<callable(): mixed> ' , $ input );
108
+ }
109
+ else {
110
+ assertType ('mixed~iterable<callable(): mixed> ' , $ input );
111
+ }
68
112
69
113
// Inspector::assertAllNotEmpty()
70
114
$ input = mixed_function ();
71
- assert (Inspector::assertAllNotEmpty ($ input ));
72
- assertType ('iterable<float|int<min, -1>|int<1, max>|object|resource|non-empty-string|non-empty-array> ' , $ input );
115
+ if (Inspector::assertAllNotEmpty ($ input )) {
116
+ assertType ('iterable<float|int<min, -1>|int<1, max>|object|resource|non-empty-string|non-empty-array> ' , $ input );
117
+ }
118
+ else {
119
+ assertType ('mixed~iterable<float|int<min, -1>|int<1, max>|object|resource|non-empty-string|non-empty-array> ' , $ input );
120
+ }
73
121
74
122
// Inspector::assertAllNumeric()
75
123
$ input = mixed_function ();
76
- assert (Inspector::assertAllNumeric ($ input ));
77
- assertType ('iterable<float|int> ' , $ input );
124
+ if (Inspector::assertAllNumeric ($ input )) {
125
+ assertType ('iterable<float|int> ' , $ input );
126
+ }
127
+ else {
128
+ assertType ('mixed~iterable<float|int> ' , $ input );
129
+ }
78
130
79
131
// Inspector::assertAllMatch()
80
132
$ pattern = 'foo ' ;
81
133
$ input = mixed_function ();
82
- assert (Inspector::assertAllMatch ($ pattern , $ input , false ));
83
- assertType ('iterable<string> ' , $ input );
134
+ if (Inspector::assertAllMatch ($ pattern , $ input , false )) {
135
+ assertType ('iterable<string> ' , $ input );
136
+ }
137
+ else {
138
+ assertType ('mixed~iterable<string> ' , $ input );
139
+ }
84
140
85
141
// Inspector::assertAllRegularExpressionMatch()
86
142
$ input = mixed_function ();
87
- assert (Inspector::assertAllRegularExpressionMatch ($ pattern , $ input ));
88
- assertType ('iterable<string> ' , $ input );
143
+ if (Inspector::assertAllRegularExpressionMatch ($ pattern , $ input )) {
144
+ assertType ('iterable<string> ' , $ input );
145
+ }
146
+ else {
147
+ assertType ('mixed~iterable<string> ' , $ input );
148
+ }
89
149
90
150
// Inspector::assertAllObjects()
91
151
$ input = mixed_function ();
92
- assert (Inspector::assertAllObjects ($ input , TranslatableMarkup::class, '\\Stringable ' , '\\Drupal \\jsonapi \\JsonApiResource \\ResourceIdentifier ' ));
93
- assertType ('iterable<\Drupal\jsonapi\JsonApiResource\ResourceIdentifier|\Stringable> ' , $ input );
152
+ if (Inspector::assertAllObjects ($ input , TranslatableMarkup::class, '\\Stringable ' , '\\Drupal \\jsonapi \\JsonApiResource \\ResourceIdentifier ' )) {
153
+ assertType ('iterable<\Drupal\jsonapi\JsonApiResource\ResourceIdentifier|\Stringable> ' , $ input );
154
+ }
155
+ else {
156
+ assertType ('mixed~iterable<\Drupal\jsonapi\JsonApiResource\ResourceIdentifier|\Stringable> ' , $ input );
157
+ }
0 commit comments