@@ -12,82 +12,146 @@ function mixed_function(): mixed {
1212// Inspector::assertAll()
1313$ callable = fn (string $ value ): bool => $ value === 'foo ' ;
1414$ 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+ }
1721
1822$ input = mixed_function ();
1923$ 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+ }
2230
2331
2432// Inspector::assertAllStrings()
2533$ 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+ }
2840
2941// Inspector::assertAllStringable()
3042$ 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+ }
3349
3450// Inspector::assertAllArrays()
3551$ 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+ }
3858
3959// Inspector::assertStrictArray()
4060$ 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+ }
4367
4468// Inspector::assertAllStrictArrays()
4569$ 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+ }
4876
4977// Inspector::assertAllHaveKey()
5078$ input = mixed_function ();
51- assert (Inspector::assertAllHaveKey ($ input , 'foo ' , 'baz ' ));
52- assertType ("iterable<non-empty-array&hasOffset('baz')&hasOffset('foo')> " , $ input );
79+ if (Inspector::assertAllHaveKey ($ input , 'foo ' , 'baz ' )) {
80+ assertType ("iterable<non-empty-array&hasOffset('baz')&hasOffset('foo')> " , $ input );
81+ }
82+ else {
83+ assertType ("mixed~iterable<non-empty-array&hasOffset('baz')&hasOffset('foo')> " , $ input );
84+ }
5385
5486// Inspector::assertAllIntegers()
5587$ 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+ }
5894
5995// Inspector::assertAllFloat()
6096$ 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+ }
63103
64104// Inspector::assertAllCallable()
65105$ 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+ }
68112
69113// Inspector::assertAllNotEmpty()
70114$ 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+ }
73121
74122// Inspector::assertAllNumeric()
75123$ 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+ }
78130
79131// Inspector::assertAllMatch()
80132$ pattern = 'foo ' ;
81133$ 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+ }
84140
85141// Inspector::assertAllRegularExpressionMatch()
86142$ 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+ }
89149
90150// Inspector::assertAllObjects()
91151$ 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