Skip to content

Commit d5b3a4b

Browse files
committed
Fix quotes in exception messages
1 parent 2f04b78 commit d5b3a4b

File tree

10 files changed

+12
-12
lines changed

10 files changed

+12
-12
lines changed

Bundle/Bundle.php

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

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

7676
// check naming convention

CacheClearer/Psr6CacheClearer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function hasPool($name)
4040
public function clearPool($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
@@ -107,7 +107,7 @@ public function isNullable()
107107
public function getDefaultValue()
108108
{
109109
if (!$this->hasDefaultValue) {
110-
throw new \LogicException(sprintf('Argument $%s does not have a default value. Use %s::hasDefaultValue() to avoid this exception.', $this->name, __CLASS__));
110+
throw new \LogicException(sprintf('Argument $%s does not have a default value. Use "%s::hasDefaultValue()" to avoid this exception.', $this->name, __CLASS__));
111111
}
112112

113113
return $this->defaultValue;

DataCollector/DumpDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public function getDumps($format, $maxDepthLimit = -1, $maxItemsPerDepth = -1)
217217
$dumper = new HtmlDumper($data, $this->charset);
218218
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
219219
} else {
220-
throw new \InvalidArgumentException(sprintf('Invalid dump format: %s.', $format));
220+
throw new \InvalidArgumentException(sprintf('Invalid dump format: "%s".', $format));
221221
}
222222
$dumps = [];
223223

DependencyInjection/ResettableServicePass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function process(ContainerBuilder $container)
4646
$attributes = $tags[0];
4747

4848
if (!isset($attributes['method'])) {
49-
throw new RuntimeException(sprintf('Tag %s requires the "method" attribute to be set.', $this->tagName));
49+
throw new RuntimeException(sprintf('Tag "%s" requires the "method" attribute to be set.', $this->tagName));
5050
}
5151

5252
$methods[$id] = $attributes['method'];

Fragment/FragmentHandler.php

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

106106
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, $uri, $alt, $ignoreErrors)
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
@@ -236,7 +236,7 @@ public function getBundle($name, $first = true/*, $noDeprecation = false */)
236236
}
237237

238238
if (!isset($this->bundleMap[$name])) {
239-
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, static::class));
239+
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, static::class));
240240
}
241241

242242
if (true === $first) {
@@ -762,10 +762,10 @@ protected function buildContainer()
762762
foreach (['cache' => $this->warmupDir ?: $this->getCacheDir(), 'logs' => $this->getLogDir()] as $name => $dir) {
763763
if (!is_dir($dir)) {
764764
if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
765-
throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n.", $name, $dir));
765+
throw new \RuntimeException(sprintf('Unable to create the "%s" directory (%s).', $name, $dir));
766766
}
767767
} elseif (!is_writable($dir)) {
768-
throw new \RuntimeException(sprintf("Unable to write in the %s directory (%s)\n.", $name, $dir));
768+
throw new \RuntimeException(sprintf('Unable to write in the "%s" directory (%s).', $name, $dir));
769769
}
770770
}
771771

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

Tests/DependencyInjection/ResettableServicePassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function testCompilerPass()
5151
public function testMissingMethod()
5252
{
5353
$this->expectException('Symfony\Component\DependencyInjection\Exception\RuntimeException');
54-
$this->expectExceptionMessage('Tag kernel.reset requires the "method" attribute to be set.');
54+
$this->expectExceptionMessage('Tag "kernel.reset" requires the "method" attribute to be set.');
5555
$container = new ContainerBuilder();
5656
$container->register(ResettableService::class)
5757
->addTag('kernel.reset');

0 commit comments

Comments
 (0)