Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Internal/Service/LockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Bavix\Wallet\Internal\Exceptions\ExceptionInterface;
use Bavix\Wallet\Internal\Exceptions\LockProviderNotFoundException;
use Illuminate\Cache\CacheManager;
use Illuminate\Contracts\Cache\Factory as CacheFactory;
use Illuminate\Config\Repository as ConfigRepository;
use Illuminate\Contracts\Cache\LockProvider;
use Illuminate\Contracts\Cache\Repository as CacheRepository;
Expand All @@ -17,10 +17,10 @@ final class LockService implements LockServiceInterface

private int $seconds;

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

/**
Expand Down
10 changes: 5 additions & 5 deletions src/WalletServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
use function config;
use function dirname;
use function function_exists;
use Illuminate\Cache\CacheManager;
use Illuminate\Contracts\Cache\Factory as CacheFactory;
use Illuminate\Support\ServiceProvider;

final class WalletServiceProvider extends ServiceProvider
Expand Down Expand Up @@ -221,8 +221,8 @@ private function services(array $configure, array $cache): void
'storageService' => $this->app->make(
StorageServiceInterface::class,
[
'cacheRepository' => $this->app->make(CacheManager::class)
->driver($cache['driver'] ?? 'array'),
'cacheRepository' => $this->app->make(CacheFactory::class)
->store($cache['driver'] ?? 'array'),
],
),
]
Expand All @@ -234,8 +234,8 @@ private function services(array $configure, array $cache): void
'storageService' => $this->app->make(
StorageServiceInterface::class,
[
'cacheRepository' => $this->app->make(CacheManager::class)
->driver('array'),
'cacheRepository' => $this->app->make(CacheFactory::class)
->store('array'),
],
),
]
Expand Down