From 0dc0d7a5f0e754a03e3cabe341e271c3d6331f0f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 16 Mar 2020 08:32:23 +0100 Subject: [PATCH] Fix quotes in exception messages --- Store/RedisStore.php | 6 +++--- Store/StoreFactory.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Store/RedisStore.php b/Store/RedisStore.php index d0c8abf..5521374 100644 --- a/Store/RedisStore.php +++ b/Store/RedisStore.php @@ -37,11 +37,11 @@ class RedisStore implements StoreInterface public function __construct($redisClient, $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 InvalidArgumentException(sprintf('%s() expects a strictly positive TTL. Got %d.', __METHOD__, $initialTtl)); + throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive TTL. Got %d.', __METHOD__, $initialTtl)); } $this->redis = $redisClient; @@ -143,7 +143,7 @@ private function evaluate($script, $resource, array $args) return \call_user_func_array([$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))); } /** diff --git a/Store/StoreFactory.php b/Store/StoreFactory.php index 2edcc1d..fecc2ce 100644 --- a/Store/StoreFactory.php +++ b/Store/StoreFactory.php @@ -35,6 +35,6 @@ public static function createStore($connection) return new MemcachedStore($connection); } - throw new InvalidArgumentException(sprintf('Unsupported Connection: %s.', \get_class($connection))); + throw new InvalidArgumentException(sprintf('Unsupported Connection: "%s".', \get_class($connection))); } }