Skip to content

Commit

Permalink
Merge pull request #91 from stof/patch-1
Browse files Browse the repository at this point in the history
Use a non-nullable property for redisClient
  • Loading branch information
clementtalleu authored Oct 23, 2024
2 parents 09c7944 + 70d2078 commit f396a3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Om/RedisObjectManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ final class RedisObjectManager implements RedisObjectManagerInterface
/** @var array<string, array<string, ObjectToPersist[]>> */
protected array $objectsToFlush = [];
protected ?KeyGenerator $keyGenerator = null;
private RedisClientInterface $redisClient;

public function __construct(
private ?RedisClientInterface $redisClient = null,
?RedisClientInterface $redisClient = null,
) {
$this->redisClient = $redisClient ?? (getenv('REDIS_CLIENT') === 'predis' ? new PredisClient() : new RedisClient());

Expand Down

0 comments on commit f396a3b

Please sign in to comment.