Skip to content

Commit

Permalink
minor #36101 Fix more quotes in exception messages (fabpot)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.4 branch.

Discussion
----------

Fix more quotes in exception messages

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

c79fe02 Fix more quotes in exception messages
  • Loading branch information
fabpot committed Mar 16, 2020
2 parents cbe50a7 + c79fe02 commit 46e441f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpClient/CurlHttpClient.php
Expand Up @@ -319,7 +319,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
if ($responses instanceof CurlResponse) {
$responses = [$responses];
} elseif (!is_iterable($responses)) {
throw new \TypeError(sprintf('%s() expects parameter 1 to be an iterable of CurlResponse objects, "%s" given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
throw new \TypeError(sprintf('"%s()" expects parameter 1 to be an iterable of CurlResponse objects, "%s" given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
}

$active = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpClient/MockHttpClient.php
Expand Up @@ -79,7 +79,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
if ($responses instanceof ResponseInterface) {
$responses = [$responses];
} elseif (!is_iterable($responses)) {
throw new \TypeError(sprintf('%s() expects parameter 1 to be an iterable of MockResponse objects, "%s" given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
throw new \TypeError(sprintf('"%s()" expects parameter 1 to be an iterable of MockResponse objects, "%s" given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
}

return new ResponseStream(MockResponse::stream($responses, $timeout));
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpClient/NativeHttpClient.php
Expand Up @@ -238,7 +238,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
if ($responses instanceof NativeResponse) {
$responses = [$responses];
} elseif (!is_iterable($responses)) {
throw new \TypeError(sprintf('%s() expects parameter 1 to be an iterable of NativeResponse objects, "%s" given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
throw new \TypeError(sprintf('"%s()" expects parameter 1 to be an iterable of NativeResponse objects, "%s" given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
}

return new ResponseStream(NativeResponse::stream($responses, $timeout));
Expand Down
Expand Up @@ -54,7 +54,7 @@ public function __construct($redis, array $options = [])
!$redis instanceof RedisProxy &&
!$redis instanceof RedisClusterProxy
) {
throw new \InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, "%s" given.', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis)));
throw new \InvalidArgumentException(sprintf('"%s()" expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, "%s" given.', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis)));
}

if ($diff = array_diff(array_keys($options), ['prefix', 'ttl'])) {
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Lock/Store/PdoStore.php
Expand Up @@ -82,7 +82,7 @@ public function __construct($connOrDsn, array $options = [], float $gcProbabilit
throw new InvalidArgumentException(sprintf('"%s" requires gcProbability between 0 and 1, "%f" given.', __METHOD__, $gcProbability));
}
if ($initialTtl < 1) {
throw new InvalidTtlException(sprintf('%s() expects a strictly positive TTL, "%d" given.', __METHOD__, $initialTtl));
throw new InvalidTtlException(sprintf('"%s()" expects a strictly positive TTL, "%d" given.', __METHOD__, $initialTtl));
}

if ($connOrDsn instanceof \PDO) {
Expand Down Expand Up @@ -156,7 +156,7 @@ public function waitAndSave(Key $key)
public function putOffExpiration(Key $key, $ttl)
{
if ($ttl < 1) {
throw new InvalidTtlException(sprintf('%s() expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl));
throw new InvalidTtlException(sprintf('"%s()" expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl));
}

$key->reduceLifetime($ttl);
Expand Down

0 comments on commit 46e441f

Please sign in to comment.