8000 Merge branch '4.4' into 5.0 · symfony/symfony@e7e5f33 · GitHub
[go: up one dir, main page]

Skip to content

Commit e7e5f33

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: Fix more quotes in exception messages Fix more quotes in exception messages [3.4] Minor fixes [PropertyAccess] Improved errors when reading uninitialized properties
2 parents 16ed2b9 + 46e441f commit e7e5f33

File tree

22 files changed

+123
-40
lines changed

22 files changed

+123
-40
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
10851085
if ($container->fileExists($dir)) {
10861086
$dirs[] = $transPaths[] = $dir;
10871087
} else {
1088-
throw new \UnexpectedValueException(sprintf('%s defined in translator.paths does not exist or is not a directory.', $dir));
1088+
throw new \UnexpectedValueException(sprintf('"%s" defined in translator.paths does not exist or is not a directory.', $dir));
10891089
}
10901090
}
10911091

src/Symfony/Component/Cache/Traits/RedisTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private function init($redisClient, string $namespace, int $defaultLifetime, ?Ma
5656
}
5757

5858
if (!$redisClient instanceof \Redis && !$redisClient instanceof \RedisArray && !$redisClient instanceof \RedisCluster && !$redisClient instanceof \Predis\ClientInterface && !$redisClient instanceof RedisProxy && !$redisClient instanceof RedisClusterProxy) {
59-
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)));
59+
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)));
6060
}
6161

6262
if ($redisClient instanceof \Predis\ClientInterface && $redisClient->getOptions()->exceptions) {

src/Symfony/Component/HttpClient/CurlHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
319319
if ($responses instanceof CurlResponse) {
320320
$responses = [$responses];
321321
} elseif (!is_iterable($responses)) {
322-
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)));
322+
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)));
323323
}
324324

325325
$active = 0;

src/Symfony/Component/HttpClient/MockHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
7979
if ($responses instanceof ResponseInterface) {
8080
$responses = [$responses];
8181
} elseif (!is_iterable($responses)) {
82-
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)));
82+
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)));
8383
}
8484

8585
return new ResponseStream(MockResponse::stream($responses, $timeout));

src/Symfony/Component/HttpClient/NativeHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
238238
if ($responses instanceof NativeResponse) {
239239
$responses = [$responses];
240240
} elseif (!is_iterable($responses)) {
241-
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)));
241+
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)));
242242
}
243243

244244
return new ResponseStream(NativeResponse::stream($responses, $timeout));

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct($redis, array $options = [])
5454
!$redis instanceof RedisProxy &&
5555
!$redis instanceof RedisClusterProxy
5656
) {
57-
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)));
57+
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)));
5858
}
5959

6060
if ($diff = array_diff(array_keys($options), ['prefix', 'ttl'])) {

src/Symfony/Component/HttpKernel/Controller/ArgumentResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function getArguments(Request $request, callable $controller): array
6262
}
6363

6464
if (!$atLeastOne) {
65-
throw new \InvalidArgumentException(sprintf('%s::resolve() must yield at least one value.', \get_class($resolver)));
65+
throw new \InvalidArgumentException(sprintf('"%s::resolve()" must yield at least one value.', \get_class($resolver)));
6666
}
6767

6868
// continue to the next controller argument

src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public function format($value, int $type = self::TYPE_DEFAULT)
360360
}
361361

362362
if (self::CURRENCY === $this->style) {
363-
throw new NotImplementedException(sprintf('%s() method does not support the formatting of currencies (instance with CURRENCY style). "%s".', __METHOD__, NotImplementedException::INTL_INSTALL_MESSAGE));
363+
throw new NotImplementedException(sprintf('"%s()" method does not support the formatting of currencies (instance with CURRENCY style). "%s".', __METHOD__, NotImplementedException::INTL_INSTALL_MESSAGE));
364364
}
365365

366366
// Only the default type is supported.

src/Symfony/Component/Lock/Store/MemcachedStore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(\Memcached $memcached, int $initialTtl = 300)
4646
}
4747

4848
if ($initialTtl < 1) {
49-
throw new InvalidArgumentException(sprintf('%s() expects a strictly positive TTL. Got %d.', __METHOD__, $initialTtl));
49+
throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive TTL. Got %d.', __METHOD__, $initialTtl));
5050
}
5151

5252
$this->memcached = $memcached;
@@ -74,7 +74,7 @@ public function save(Key $key)
7474
public function putOffExpiration(Key $key, float $ttl)
7575
{
7676
if ($ttl < 1) {
77-
throw new InvalidTtlException(sprintf('%s() expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl));
77+
throw new InvalidTtlException(sprintf('"%s()" expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl));
7878
}
7979

8080
// Interface defines a float value but Store required an integer.

src/Symfony/Component/Lock/Store/PdoStore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function __construct($connOrDsn, array $options = [], float $gcProbabilit
8181
throw new InvalidArgumentException(sprintf('"%s" requires gcProbability between 0 and 1, "%f" given.', __METHOD__, $gcProbability));
8282
}
8383
if ($initialTtl < 1) {
84-
throw new InvalidTtlException(sprintf('%s() expects a strictly positive TTL, "%d" given.', __METHOD__, $initialTtl));
84+
throw new InvalidTtlException(sprintf('"%s()" expects a strictly positive TTL, "%d" given.', __METHOD__, $initialTtl));
8585
}
8686

8787
if ($connOrDsn instanceof \PDO) {
@@ -146,7 +146,7 @@ public function save(Key $key)
146146
public function putOffExpiration(Key $key, float $ttl)
147147
{
148148
if ($ttl < 1) {
149-
throw new InvalidTtlException(sprintf('%s() expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl));
149+
throw new InvalidTtlException(sprintf('"%s()" expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl));
150150
}
151151

152152
$key->reduceLifetime($ttl);

0 commit comments

Comments
 (0)
0