Skip to content

Commit

Permalink
Merge branch '3.4' into 4.4
Browse files Browse the repository at this point in the history
* 3.4:
  Fix quotes in exception messages
  • Loading branch information
fabpot committed Mar 16, 2020
2 parents cee3a33 + 0dc0d7a commit ae5d89e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Store/RedisStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ class RedisStore implements StoreInterface
public function __construct($redisClient, float $initialTtl = 300.0)
{
if (!$redisClient instanceof \Redis && !$redisClient instanceof \RedisArray && !$redisClient instanceof \RedisCluster && !$redisClient instanceof \Predis\ClientInterface && !$redisClient instanceof RedisProxy) {
throw new InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, %s given.', __METHOD__, \is_object($redisClient) ? \get_class($redisClient) : \gettype($redisClient)));
throw new InvalidArgumentException(sprintf('"%s()" expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, "%s" given.', __METHOD__, \is_object($redisClient) ? \get_class($redisClient) : \gettype($redisClient)));
}

if ($initialTtl <= 0) {
throw new InvalidTtlException(sprintf('%s() expects a strictly positive TTL. Got %d.', __METHOD__, $initialTtl));
throw new InvalidTtlException(sprintf('"%s()" expects a strictly positive TTL. Got %d.', __METHOD__, $initialTtl));
}

$this->redis = $redisClient;
Expand Down Expand Up @@ -153,7 +153,7 @@ private function evaluate(string $script, string $resource, array $args)
return $this->redis->eval(...array_merge([$script, 1, $resource], $args));
}

throw new InvalidArgumentException(sprintf('%s() expects being initialized with a Redis, RedisArray, RedisCluster or Predis\ClientInterface, %s given.', __METHOD__, \is_object($this->redis) ? \get_class($this->redis) : \gettype($this->redis)));
throw new InvalidArgumentException(sprintf('%s() expects being initialized with a Redis, RedisArray, RedisCluster or Predis\ClientInterface, "%s" given.', __METHOD__, \is_object($this->redis) ? \get_class($this->redis) : \gettype($this->redis)));
}

private function getUniqueToken(Key $key): string
Expand Down
2 changes: 1 addition & 1 deletion Store/StoreFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ public static function createStore($connection)
return new ZookeeperStore(ZookeeperStore::createConnection($connection));
}

throw new InvalidArgumentException(sprintf('Unsupported Connection: %s.', $connection));
throw new InvalidArgumentException(sprintf('Unsupported Connection: "%s".', $connection));
}
}

0 comments on commit ae5d89e

Please sign in to comment.