Skip to content

Commit

Permalink
add assert array for properties
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Oct 16, 2023
1 parent 11fcb7a commit 9c49724
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion system/BaseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -1656,8 +1656,10 @@ protected function objectToArray($data, bool $onlyChanged = true, bool $recursiv
{
$properties = $this->objectToRawArray($data, $onlyChanged, $recursive);

assert(is_array($properties));

// Convert any Time instances to appropriate $dateFormat
if ($properties !== null && $properties !== []) {
if ($properties !== []) {
$properties = array_map(function ($value) {
if ($value instanceof Time) {
return $this->timeToDate($value);
Expand Down

0 comments on commit 9c49724

Please sign in to comment.