@@ -58,11 +58,11 @@ public static function accepts(Type $type, mixed $value): bool
58
58
foreach ($ value as $ key => $ itemValue ) {
59
59
$ valueType = $ type ->getShape ()[$ key ]['type ' ] ?? false ;
60
60
61
- if ($ valueType && !TypeHelper ::accepts ($ valueType , $ itemValue )) {
61
+ if ($ valueType && !self ::accepts ($ valueType , $ itemValue )) {
62
62
return false ;
63
63
}
64
64
65
- if (!$ valueType && ($ type ->isSealed () || !TypeHelper ::accepts ($ type ->getExtraKeyType (), $ key ) || !TypeHelper ::accepts ($ type ->getExtraValueType (), $ itemValue ))) {
65
+ if (!$ valueType && ($ type ->isSealed () || !self ::accepts ($ type ->getExtraKeyType (), $ key ) || !self ::accepts ($ type ->getExtraValueType (), $ itemValue ))) {
66
66
return false ;
67
67
}
68
68
}
@@ -73,6 +73,7 @@ public static function accepts(Type $type, mixed $value): bool
73
73
// Also supports EnumType and BackedEnumType
74
74
if ($ type instanceof Type \ObjectType) {
75
75
$ className = $ type ->getClassName ();
76
+
76
77
return $ value instanceof $ className ;
77
78
}
78
79
@@ -110,7 +111,7 @@ public static function accepts(Type $type, mixed $value): bool
110
111
if (is_iterable ($ value )) {
111
112
foreach ($ value as $ k => $ v ) {
112
113
// key or value do not match
113
- if (!TypeHelper ::accepts ($ keyType , $ k ) || !TypeHelper ::accepts ($ valueType , $ v )) {
114
+ if (!self ::accepts ($ keyType , $ k ) || !self ::accepts ($ valueType , $ v )) {
114
115
return false ;
115
116
}
116
117
}
0 commit comments