Skip to content

Commit f97fa1f

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 875414e + eb80a94 commit f97fa1f

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

Bundle/Bundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function getContainerExtension()
6969

7070
if (null !== $extension) {
7171
if (!$extension instanceof ExtensionInterface) {
72-
throw new \LogicException(sprintf('Extension %s must implement Symfony\Component\DependencyInjection\Extension\ExtensionInterface.', \get_class($extension)));
72+
throw new \LogicException(sprintf('Extension "%s" must implement Symfony\Component\DependencyInjection\Extension\ExtensionInterface.', \get_class($extension)));
7373
}
7474

7575
// check naming convention

CacheClearer/Psr6CacheClearer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function hasPool(string $name)
3131
public function getPool(string $name)
3232
{
3333
if (!$this->hasPool($name)) {
34-
throw new \InvalidArgumentException(sprintf('Cache pool not found: %s.', $name));
34+
throw new \InvalidArgumentException(sprintf('Cache pool not found: "%s".', $name));
3535
}
3636

3737
return $this->pools[$name];
@@ -40,7 +40,7 @@ public function getPool(string $name)
4040
public function clearPool(string $name)
4141
{
4242
if (!isset($this->pools[$name])) {
43-
throw new \InvalidArgumentException(sprintf('Cache pool not found: %s.', $name));
43+
throw new \InvalidArgumentException(sprintf('Cache pool not found: "%s".', $name));
4444
}
4545

4646
return $this->pools[$name]->clear();

ControllerMetadata/ArgumentMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function isNullable()
9999
public function getDefaultValue()
100100
{
101101
if (!$this->hasDefaultValue) {
102-
throw new \LogicException(sprintf('Argument $%s does not have a default value. Use %s::hasDefaultValue() to avoid this exception.', $this->name, __CLASS__));
102+
throw new \LogicException(sprintf('Argument $%s does not have a default value. Use "%s::hasDefaultValue()" to avoid this exception.', $this->name, __CLASS__));
103103
}
104104

105105
return $this->defaultValue;

DataCollector/DumpDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function getDumps($format, $maxDepthLimit = -1, $maxItemsPerDepth = -1):
193193
$dumper = new HtmlDumper($data, $this->charset);
194194
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
195195
} else {
196-
throw new \InvalidArgumentException(sprintf('Invalid dump format: %s.', $format));
196+
throw new \InvalidArgumentException(sprintf('Invalid dump format: "%s".', $format));
197197
}
198198
$dumps = [];
199199

Fragment/FragmentHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function render($uri, string $renderer = 'inline', array $options = [])
9797
protected function deliver(Response $response)
9898
{
9999
if (!$response->isSuccessful()) {
100-
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $this->requestStack->getCurrentRequest()->getUri(), $response->getStatusCode()));
100+
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %d).', $this->requestStack->getCurrentRequest()->getUri(), $response->getStatusCode()));
101101
}
102102

103103
if (!$response instanceof StreamedResponse) {

HttpCache/AbstractSurrogate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreE
9696
$response = $cache->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);
9797

9898
if (!$response->isSuccessful()) {
99-
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $subRequest->getUri(), $response->getStatusCode()));
99+
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %d).', $subRequest->getUri(), $response->getStatusCode()));
100100
}
101101

102102
return $response->getContent();

Kernel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function getBundle(string $name)
221221
$class = static::class;
222222
$class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
223223

224-
throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your %s.php file?', $name, $class));
224+
throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the "registerBundles()" method of your "%s.php" file?', $name, $class));
225225
}
226226

227227
return $this->bundles[$name];
@@ -624,10 +624,10 @@ protected function buildContainer()
624624
foreach (['cache' => $this->warmupDir ?: $this->getCacheDir(), 'logs' => $this->getLogDir()] as $name => $dir) {
625625
if (!is_dir($dir)) {
626626
if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
627-
throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n.", $name, $dir));
627+
throw new \RuntimeException(sprintf('Unable to create the "%s" directory (%s).', $name, $dir));
628628
}
629629
} elseif (!is_writable($dir)) {
630-
throw new \RuntimeException(sprintf("Unable to write in the %s directory (%s)\n.", $name, $dir));
630+
throw new \RuntimeException(sprintf('Unable to write in the "%s" directory (%s).', $name, $dir));
631631
}
632632
}
633633

Tests/CacheClearer/Psr6CacheClearerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testClearPool()
4040
public function testClearPoolThrowsExceptionOnUnreferencedPool()
4141
{
4242
$this->expectException('InvalidArgumentException');
43-
$this->expectExceptionMessage('Cache pool not found: unknown');
43+
$this->expectExceptionMessage('Cache pool not found: "unknown"');
4444
(new Psr6CacheClearer())->clearPool('unknown');
4545
}
4646
}

0 commit comments

Comments
 (0)