Skip to content

Commit

Permalink
Prevent conflicts between method-local vs. arrow-function variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstewartja committed Feb 17, 2023
1 parent 9f61af0 commit f6c8fba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/LaravelAttributeObserverServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private function modelHasAttribute(Model $model, string $attribute): bool
private function wasChanged(Model $model, string $event, string $attribute = null): bool
{
// Pull past-tense/post-mutation events from constants array
$postEvents = array_filter(self::EVENTS, fn ($event) => Str::endsWith($event, 'ed'));
$postEvents = array_filter(self::EVENTS, fn ($e) => Str::endsWith($e, 'ed'));

if (in_array($event, $postEvents)) {
return $attribute
Expand Down

0 comments on commit f6c8fba

Please sign in to comment.