Skip to content

Commit 8e50f1d

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: Fix quotes in exception messages Fix quotes in exception messages Fix quotes in exception messages
2 parents 2aec33d + b234f66 commit 8e50f1d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Store/RedisStore.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ class RedisStore implements PersistingStoreInterface
3838
public function __construct($redisClient, float $initialTtl = 300.0)
3939
{
4040
if (!$redisClient instanceof \Redis && !$redisClient instanceof \RedisArray && !$redisClient instanceof \RedisCluster && !$redisClient instanceof \Predis\ClientInterface && !$redisClient instanceof RedisProxy) {
41-
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)));
41+
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)));
4242
}
4343

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

4848
$this->redis = $redisClient;
@@ -141,7 +141,7 @@ private function evaluate(string $script, string $resource, array $args)
141141
return $this->redis->eval(...array_merge([$script, 1, $resource], $args));
142142
}
143143

144-
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)));
144+
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)));
145145
}
146146

147147
private function getUniqueToken(Key $key): string

Store/StoreFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class StoreFactory
3333
public static function createStore($connection)
3434
{
3535
if (!\is_string($connection) && !\is_object($connection)) {
36-
throw new \TypeError(sprintf('Argument 1 passed to %s() must be a string or a connection object, %s given.', __METHOD__, \gettype($connection)));
36+
throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a string or a connection object, "%s" given.', __METHOD__, \gettype($connection)));
3737
}
3838

3939
switch (true) {
@@ -56,7 +56,7 @@ public static function createStore($connection)
5656
return new ZookeeperStore($connection);
5757

5858
case !\is_string($connection):
59-
throw new InvalidArgumentException(sprintf('Unsupported Connection: %s.', \get_class($connection)));
59+
throw new InvalidArgumentException(sprintf('Unsupported Connection: "%s".', \get_class($connection)));
6060
case 'flock' === $connection:
6161
return new FlockStore();
6262

@@ -95,6 +95,6 @@ public static function createStore($connection)
9595
return new ZookeeperStore(ZookeeperStore::createConnection($connection));
9696
}
9797

98-
throw new InvalidArgumentException(sprintf('Unsupported Connection: %s.', $connection));
98+
throw new InvalidArgumentException(sprintf('Unsupported Connection: "%s".', $connection));
9999
}
100100
}

Store/ZookeeperStore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ public function __construct(\Zookeeper $zookeeper)
3737
public static function createConnection(string $dsn): \Zookeeper
3838
{
3939
if (0 !== strpos($dsn, 'zookeeper:')) {
40-
throw new InvalidArgumentException(sprintf('Unsupported DSN: %s.', $dsn));
40+
throw new InvalidArgumentException(sprintf('Unsupported DSN: "%s".', $dsn));
4141
}
4242

4343
if (false === $params = parse_url($dsn)) {
44-
throw new InvalidArgumentException(sprintf('Invalid Zookeeper DSN: %s.', $dsn));
44+
throw new InvalidArgumentException(sprintf('Invalid Zookeeper DSN: "%s".', $dsn));
4545
}
4646

4747
$host = $params['host'] ?? '';

0 commit comments

Comments
 (0)