File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -125,10 +125,6 @@ public function __construct(array $data)
125
125
{
126
126
$ this ->hydrate ($ data );
127
127
128
- if (!$ this ->type ) {
129
- $ this ->type = 'string ' ;
130
- }
131
-
132
128
$ this ->required = (bool )$ this ->required ;
133
129
134
130
$ this ->stockLocation ($ data );
@@ -272,7 +268,7 @@ private function hasCorrectType($userValue)
272
268
{
273
269
// Helper fn to see whether an array is associative (i.e. a JSON object)
274
270
$ isAssociative = function ($ value ) {
275
- return is_array ($ value ) && ( bool ) count ( array_filter ( array_keys ($ value ), ' is_string ' ) );
271
+ return is_array ($ value ) && array_keys ($ value ) !== range ( 0 , count ( $ value ) - 1 );
276
272
};
277
273
278
274
// For params defined as objects, we'll let the user get away with
@@ -285,6 +281,10 @@ private function hasCorrectType($userValue)
285
281
return is_a ($ userValue , $ this ->type );
286
282
}
287
283
284
+ if (!$ this ->type ) {
285
+ return true ;
286
+ }
287
+
288
288
return gettype ($ userValue ) == $ this ->type ;
289
289
}
290
290
You can’t perform that action at this time.
0 commit comments