Skip to content

Commit cbe50a7

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Fix more quotes in exception messages [3.4] Minor fixes [PropertyAccess] Improved errors when reading uninitialized properties
2 parents 4a7fcda + 2baa812 commit cbe50a7

File tree

17 files changed

+117
-34
lines changed

17 files changed

+117
-34
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
11961196
if ($container->fileExists($dir)) {
11971197
$dirs[] = $transPaths[] = $dir;
11981198
} else {
1199-
throw new \UnexpectedValueException(sprintf('%s defined in translator.paths does not exist or is not a directory.', $dir));
1199+
throw new \UnexpectedValueException(sprintf('"%s" defined in translator.paths does not exist or is not a directory.', $dir));
12001200
}
12011201
}
12021202

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/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, $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
@@ -363,7 +363,7 @@ public function format($value, $type = self::TYPE_DEFAULT)
363363
}
364364

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

369369
// 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
@@ -47,7 +47,7 @@ public function __construct(\Memcached $memcached, int $initialTtl = 300)
4747
}
4848

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

5353
$this->memcached = $memcached;
@@ -86,7 +86,7 @@ public function waitAndSave(Key $key)
8686
public function putOffExpiration(Key $key, $ttl)
8787
{
8888
if ($ttl < 1) {
89-
throw new InvalidTtlException(sprintf('%s() expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl));
89+
throw new InvalidTtlException(sprintf('"%s()" expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl));
9090
}
9191

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private function evaluate(string $script, string $resource, array $args)
153153
return $this->redis->eval(...array_merge([$script, 1, $resource], $args));
154154
}
155155

156-
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)));
156+
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)));
157157
}
158158

159159
private function getUniqueToken(Key $key): string

src/Symfony/Component/Process/InputStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function write($input)
4545
return;
4646
}
4747
if ($this->isClosed()) {
48-
throw new RuntimeException(sprintf('%s is closed.', static::class));
48+
throw new RuntimeException(sprintf('"%s" is closed.', static::class));
4949
}
5050
$this->input[] = ProcessUtils::validateInput(__METHOD__, $input);
5151
}

src/Symfony/Component/Process/Pipes/AbstractPipes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected function write(): ?array
103103
} elseif (!isset($this->inputBuffer[0])) {
104104
if (!\is_string($input)) {
105105
if (!is_scalar($input)) {
106-
throw new InvalidArgumentException(sprintf('%s yielded a value of type "%s", but only scalars and stream resources are supported.', \get_class($this->input), \gettype($input)));
106+
throw new InvalidArgumentException(sprintf('"%s" yielded a value of type "%s", but only scalars and stream resources are supported.', \get_class($this->input), \gettype($input)));
107107
}
108108
$input = (string) $input;
109109
}

src/Symfony/Component/Process/ProcessUtils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static function validateInput($caller, $input)
6161
return new \IteratorIterator($input);
6262
}
6363

64-
throw new InvalidArgumentException(sprintf('%s only accepts strings, Traversable objects or stream resources.', $caller));
64+
throw new InvalidArgumentException(sprintf('"%s" only accepts strings, Traversable objects or stream resources.', $caller));
6565
}
6666

6767
return $input;

src/Symfony/Component/Process/Tests/ProcessTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public function testSetInputWhileRunningThrowsAnException()
293293
public function testInvalidInput($value)
294294
{
295295
$this->expectException('Symfony\Component\Process\Exception\InvalidArgumentException');
296-
$this->expectExceptionMessage('Symfony\Component\Process\Process::setInput only accepts strings, Traversable objects or stream resources.');
296+
$this->expectExceptionMessage('"Symfony\Component\Process\Process::setInput" only accepts strings, Traversable objects or stream resources.');
297297
$process = $this->getProcess('foo');
298298
$process->setInput($value);
299299
}

0 commit comments

Comments
 (0)