Skip to content

Commit ad7c74f

Browse files
authored
Update Entity.php
1 parent 96a9d12 commit ad7c74f

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

system/Entity.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)