Skip to content

Commit 027a0f2

Browse files
committed
fix: Apply suggestion
1 parent 207559c commit 027a0f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

system/Entity/Entity.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ public function fill(?array $data = null)
188188
*/
189189
public function toArray(bool $onlyChanged = false, bool $cast = true, bool $recursive = false): array
190190
{
191-
$lastCastStatus = $this->_cast;
192-
$this->_cast = $cast;
191+
$originalCast = $this->_cast;
192+
$this->_cast = $cast;
193193

194194
$keys = array_filter(array_keys($this->attributes), static fn ($key): bool => ! str_starts_with($key, '_'));
195195

@@ -218,7 +218,7 @@ public function toArray(bool $onlyChanged = false, bool $cast = true, bool $recu
218218
}
219219
}
220220

221-
$this->_cast = $lastCastStatus;
221+
$this->_cast = $originalCast;
222222

223223
return $return;
224224
}

0 commit comments

Comments
 (0)