Skip to content

Commit 6a97fe0

Browse files
authored
[12.x] Use scopedIf in CacheManager::memo() (#57833)
* refactor: use scopedIf in CacheManager::memo() * fix: styleci
1 parent cfaf36a commit 6a97fe0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Illuminate/Cache/CacheManager.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,9 @@ public function memo($driver = null)
8181
{
8282
$driver = $driver ?: $this->getDefaultDriver();
8383

84-
if (! $this->app->bound($bindingKey = "cache.__memoized:{$driver}")) {
85-
$this->app->scoped($bindingKey, fn () => $this->repository(
86-
new MemoizedStore($driver, $this->store($driver)), ['events' => false]
87-
));
88-
}
84+
$this->app->scopedIf($bindingKey = "cache.__memoized:{$driver}", fn () => $this->repository(
85+
new MemoizedStore($driver, $this->store($driver)), ['events' => false]
86+
));
8987

9088
return $this->app->make($bindingKey);
9189
}

0 commit comments

Comments
 (0)