Skip to content

Commit dcbec3b

Browse files
committed
refactor: run rector
1 parent d060d8a commit dcbec3b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

system/Entity/Entity.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ private function hasChangedAttributes(?string $key = null): bool
273273
{
274274
// If no parameter was given then check all attributes
275275
if ($key === null) {
276-
foreach ($this->attributes as $key => $value) {
276+
foreach (array_keys($this->attributes) as $key) {
277277
if ($this->isChanged($key)) {
278278
return true;
279279
}
@@ -537,13 +537,11 @@ public function __get(string $key)
537537
*/
538538
private function _getCastData(string $key, array $data)
539539
{
540-
$result = null;
541-
542540
if (array_key_exists($key, $data)) {
543-
$result = $this->castAs($data[$key], $key);
541+
return $this->castAs($data[$key], $key);
544542
}
545543

546-
return $result;
544+
return null;
547545
}
548546

549547
/**

0 commit comments

Comments
 (0)