@@ -16,25 +16,28 @@ class Foo
1616 public function doFoo (): void
1717 {
1818 if (!empty ($ this ->config ['authors ' ])) {
19+ assertType ("mixed~(0|0.0|''|'0'|array{}|false|null) " , $ this ->config ['authors ' ]);
1920 foreach ($ this ->config ['authors ' ] as $ key => $ author ) {
21+ assertType ("iterable " , $ this ->config ['authors ' ]);
22+
2023 if (!is_array ($ author )) {
2124 $ this ->errors [] = 'authors. ' .$ key .' : should be an array, ' .gettype ($ author ).' given ' ;
22- assertType ("mixed " , $ this ->config ['authors ' ]);
25+ assertType ("iterable " , $ this ->config ['authors ' ]);
2326 unset($ this ->config ['authors ' ][$ key ]);
24- assertType ("mixed " , $ this ->config ['authors ' ]);
27+ assertType ("iterable " , $ this ->config ['authors ' ]);
2528 continue ;
2629 }
27- assertType ("mixed " , $ this ->config ['authors ' ]);
30+ assertType ("iterable " , $ this ->config ['authors ' ]);
2831 foreach (['homepage ' , 'email ' , 'name ' , 'role ' ] as $ authorData ) {
2932 if (isset ($ author [$ authorData ]) && !is_string ($ author [$ authorData ])) {
3033 $ this ->errors [] = 'authors. ' .$ key .'. ' .$ authorData .' : invalid value, must be a string ' ;
3134 unset($ this ->config ['authors ' ][$ key ][$ authorData ]);
3235 }
3336 }
3437 if (isset ($ author ['homepage ' ])) {
35- assertType ("mixed " , $ this ->config ['authors ' ]);
38+ assertType ("iterable " , $ this ->config ['authors ' ]);
3639 unset($ this ->config ['authors ' ][$ key ]['homepage ' ]);
37- assertType ("mixed " , $ this ->config ['authors ' ]);
40+ assertType ("iterable " , $ this ->config ['authors ' ]);
3841 }
3942 if (isset ($ author ['email ' ]) && !filter_var ($ author ['email ' ], FILTER_VALIDATE_EMAIL )) {
4043 unset($ this ->config ['authors ' ][$ key ]['email ' ]);
@@ -44,8 +47,8 @@ public function doFoo(): void
4447 }
4548 }
4649
47- assertType ("non-empty-array&hasOffsetValue('authors', mixed) " , $ this ->config );
48- assertType ("mixed " , $ this ->config ['authors ' ]);
50+ assertType ("non-empty-array&hasOffsetValue('authors', mixed~(0|0.0|''|'0'|array{}|false|null) ) " , $ this ->config );
51+ assertType ("mixed~(0|0.0|''|'0'|array{}|false|null) " , $ this ->config ['authors ' ]);
4952
5053 if (empty ($ this ->config ['authors ' ])) {
5154 unset($ this ->config ['authors ' ]);
@@ -54,7 +57,7 @@ public function doFoo(): void
5457 assertType ("non-empty-array&hasOffsetValue('authors', mixed~(0|0.0|''|'0'|array{}|false|null)) " , $ this ->config );
5558 }
5659
57- assertType (' array ' , $ this ->config );
60+ assertType (" non-empty- array&hasOffsetValue('authors', mixed~(0|0.0|''|'0'|array{}|false|null)) " , $ this ->config );
5861 }
5962 }
6063
0 commit comments