Skip to content

Commit

Permalink
Extension: use IStorage instead of Storage
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Jul 10, 2021
1 parent a875ec4 commit f233255
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/DI/RedisExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Contributte\Redis\Caching\RedisStorage;
use Contributte\Redis\Exception\Logic\InvalidStateException;
use Contributte\Redis\Tracy\RedisPanel;
use Nette\Caching\Storage;
use Nette\Caching\IStorage;
use Nette\DI\CompilerExtension;
use Nette\DI\Definitions\ServiceDefinition;
use Nette\Http\Session;
Expand Down Expand Up @@ -91,11 +91,11 @@ public function beforeCompileStorage(): void
}

// Validate needed services
if ($builder->getByType(Storage::class) === null) {
throw new RuntimeException(sprintf('Please install nette/caching package. %s is required', Storage::class));
if ($builder->getByType(IStorage::class) === null) {
throw new RuntimeException(sprintf('Please install nette/caching package. %s is required', IStorage::class));
}

$builder->getDefinitionByType(Storage::class)
$builder->getDefinitionByType(IStorage::class)
->setAutowired(false);

$builder->addDefinition($this->prefix('connection.' . $name . 'storage'))
Expand Down

0 comments on commit f233255

Please sign in to comment.