Skip to content

Commit

Permalink
Update DefaultExtension.php
Browse files Browse the repository at this point in the history
  • Loading branch information
wisskid authored May 30, 2024
1 parent 9316a42 commit ef2fa74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Extension/DefaultExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ public function smarty_modifier_json_encode($value, $flags = 0, string $input_en

# convert object to array if necessary
if (is_object($data)) {
if (is_a($data, '\JsonSerializable')) { # this is the only reason why this function is not generic
if (is_a($data, \JsonSerializable::class)) { # this is the only reason why this function is not generic
return $data;
}
$data = get_object_vars($data); # public properties as key => value pairs
Expand Down

0 comments on commit ef2fa74

Please sign in to comment.