Skip to content

Commit

Permalink
Merge pull request #89 from clementtalleu/fix/predis_client
Browse files Browse the repository at this point in the history
fix choice of redis client
  • Loading branch information
clementtalleu authored Sep 22, 2024
2 parents c722233 + 5761acb commit 62b5827
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Om/Persister/AbstractPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private ?KeyGenerator $keyGenerator = null,
protected ?RedisClientInterface $redis = null
) {
$this->redis = $redis ?? getenv('REDIS_CLIENT') === 'predis' ? new PredisClient() : new RedisClient();
$this->redis = $redis ?? (getenv('REDIS_CLIENT') === 'predis' ? new PredisClient() : new RedisClient());

$this->keyGenerator = $keyGenerator ?? new KeyGenerator();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Om/RedisObjectManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class RedisObjectManager implements RedisObjectManagerInterface
public function __construct(
private ?RedisClientInterface $redisClient = null,
) {
$this->redisClient = getenv('REDIS_CLIENT') === 'predis' ? new PredisClient() : new RedisClient();
$this->redisClient = $redisClient ?? (getenv('REDIS_CLIENT') === 'predis' ? new PredisClient() : new RedisClient());

$this->keyGenerator = new KeyGenerator();
}
Expand Down

0 comments on commit 62b5827

Please sign in to comment.