File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -398,14 +398,14 @@ protected function castAs($value, string $type)
398398
399399 $ value = (array )$ value ;
400400 break ;
401- case 'json ' :
401+ case 'json ' :
402402 if (function_exists ('json_decode ' ) && is_string ($ value ) && (strpos ($ value , '[ ' ) === 0 || strpos ($ value , '{ ' ) === 0 ))
403403 {
404404 $ value = json_decode ($ value , false );
405- $ json_last_error = json_last_error ();
406- if ($ json_last_error !== JSON_ERROR_NONE )
405+
406+ if (json_last_error () !== JSON_ERROR_NONE )
407407 {
408- throw CastException::forInvalidJsonFormatException ($ json_last_error );
408+ throw CastException::forInvalidJsonFormatException (json_last_error () );
409409 }
410410 }
411411 $ value = (object )$ value ;
@@ -414,10 +414,10 @@ protected function castAs($value, string $type)
414414 if (function_exists ('json_decode ' ) && is_string ($ value ) && (strpos ($ value , '[ ' ) === 0 || strpos ($ value , '{ ' ) === 0 ))
415415 {
416416 $ value = json_decode ($ value , true );
417- $ json_last_error = json_last_error ();
418- if ($ json_last_error !== JSON_ERROR_NONE )
417+
418+ if (json_last_error () !== JSON_ERROR_NONE )
419419 {
420- throw CastException::forInvalidJsonFormatException ($ json_last_error );
420+ throw CastException::forInvalidJsonFormatException (json_last_error () );
421421 }
422422 }
423423 $ value = (array )$ value ;
You can’t perform that action at this time.
0 commit comments