Skip to content

Commit f351991

Browse files
committed
add assert array for properties
1 parent 15e91b2 commit f351991

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

system/BaseModel.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,8 +1656,10 @@ protected function objectToArray($data, bool $onlyChanged = true, bool $recursiv
16561656
{
16571657
$properties = $this->objectToRawArray($data, $onlyChanged, $recursive);
16581658

1659+
assert(is_array($properties));
1660+
16591661
// Convert any Time instances to appropriate $dateFormat
1660-
if ($properties !== null && $properties !== []) {
1662+
if ($properties !== []) {
16611663
$properties = array_map(function ($value) {
16621664
if ($value instanceof Time) {
16631665
return $this->timeToDate($value);

0 commit comments

Comments
 (0)