Skip to content

Commit

Permalink
Reordered the $class variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rennokki authored Jun 14, 2020
1 parent 3bc3da9 commit d167965
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FlushQueryCacheObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ public function restored(Model $model)
*/
protected function invalidateCache(Model $model): void
{
$class = get_class($model);

if (! $model->getCacheTagsToInvalidateOnUpdate()) {
throw new Exception('Automatic invalidation for '.$class.' works only if at least one tag to be invalidated is specified.');
}

$class = get_class($model);

$class::flushQueryCache(
$model->getCacheTagsToInvalidateOnUpdate()
);
Expand Down

0 comments on commit d167965

Please sign in to comment.