Skip to content

Commit 72b7b36

Browse files
Beagonrez1dent3
authored andcommitted
Change CacheManager to CacheFactory for compatibility with Lumen
1 parent cabab99 commit 72b7b36

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Internal/Service/LockService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Bavix\Wallet\Internal\Exceptions\ExceptionInterface;
88
use Bavix\Wallet\Internal\Exceptions\LockProviderNotFoundException;
9-
use Illuminate\Cache\CacheManager;
9+
use Illuminate\Contracts\Cache\Factory as CacheFactory;
1010
use Illuminate\Config\Repository as ConfigRepository;
1111
use Illuminate\Contracts\Cache\LockProvider;
1212
use Illuminate\Contracts\Cache\Repository as CacheRepository;
@@ -17,10 +17,10 @@ final class LockService implements LockServiceInterface
1717

1818
private int $seconds;
1919

20-
public function __construct(CacheManager $cacheManager, ConfigRepository $config)
20+
public function __construct(CacheFactory $cacheFactory, ConfigRepository $config)
2121
{
2222
$this->seconds = (int) $config->get('wallet.lock.seconds', 1);
23-
$this->cache = $cacheManager->driver($config->get('wallet.lock.driver', 'array'));
23+
$this->cache = $cacheFactory->store($config->get('wallet.lock.driver', 'array'));
2424
}
2525

2626
/**

src/WalletServiceProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
use function config;
9898
use function dirname;
9999
use function function_exists;
100-
use Illuminate\Cache\CacheManager;
100+
use Illuminate\Contracts\Cache\Factory as CacheFactory;
101101
use Illuminate\Support\ServiceProvider;
102102

103103
final class WalletServiceProvider extends ServiceProvider
@@ -221,8 +221,8 @@ private function services(array $configure, array $cache): void
221221
'storageService' => $this->app->make(
222222
StorageServiceInterface::class,
223223
[
224-
'cacheRepository' => $this->app->make(CacheManager::class)
225-
->driver($cache['driver'] ?? 'array'),
224+
'cacheRepository' => $this->app->make(CacheFactory::class)
225+
->store($cache['driver'] ?? 'array'),
226226
],
227227
),
228228
]
@@ -234,8 +234,8 @@ private function services(array $configure, array $cache): void
234234
'storageService' => $this->app->make(
235235
StorageServiceInterface::class,
236236
[
237-
'cacheRepository' => $this->app->make(CacheManager::class)
238-
->driver('array'),
237+
'cacheRepository' => $this->app->make(CacheFactory::class)
238+
->store('array'),
239239
],
240240
),
241241
]

0 commit comments

Comments
 (0)