Skip to content

Commit

Permalink
Replace isset with the more appropriate array_key_exists
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmoore committed Jan 22, 2025
1 parent 8a1b6b0 commit 8f512e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Observers/AssetObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function updating(Asset $asset)
$changed = [];

foreach ($asset->getRawOriginal() as $key => $value) {
if (isset($asset->getAttributes()[$key]) && ($asset->getRawOriginal()[$key] != $asset->getAttributes()[$key])) {
if ((array_key_exists($key, $asset->getAttributes())) && ($asset->getRawOriginal()[$key] != $asset->getAttributes()[$key])) {
$changed[$key]['old'] = $asset->getRawOriginal()[$key];
$changed[$key]['new'] = $asset->getAttributes()[$key];
}
Expand Down

0 comments on commit 8f512e5

Please sign in to comment.