Skip to content

Commit

Permalink
refactor: run rector
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Sep 23, 2023
1 parent 05b572a commit 68683c0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions system/Entity/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private function hasChangedAttributes(?string $key = null): bool
{
// If no parameter was given then check all attributes
if ($key === null) {
foreach ($this->attributes as $key => $value) {
foreach (array_keys($this->attributes) as $key) {
if ($this->isChanged($key)) {
return true;
}
Expand Down Expand Up @@ -574,13 +574,11 @@ public function __get(string $key)
*/
private function _getCastData(string $key, array $data)
{
$result = null;

if (array_key_exists($key, $data)) {
$result = $this->castAs($data[$key], $key);
return $this->castAs($data[$key], $key);
}

return $result;
return null;
}

/**
Expand Down

0 comments on commit 68683c0

Please sign in to comment.