Skip to content

Commit a4f9145

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Fix quotes in exception messages
2 parents b28f5e2 + a0ce708 commit a4f9145

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Routing/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ private function resolve($value)
171171
return (string) $this->resolve($resolved);
172172
}
173173

174-
throw new RuntimeException(sprintf('The container parameter "%s", used in the route configuration value "%s", must be a string or numeric, but it is of type %s.', $match[1], $value, \gettype($resolved)));
174+
throw new RuntimeException(sprintf('The container parameter "%s", used in the route configuration value "%s", must be a string or numeric, but it is of type "%s".', $match[1], $value, \gettype($resolved)));
175175
}, $value);
176176

177177
return str_replace('%%', '%', $escapedValue);

Test/KernelTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ private function doTearDown()
5757
protected static function getKernelClass()
5858
{
5959
if (!isset($_SERVER['KERNEL_CLASS']) && !isset($_ENV['KERNEL_CLASS'])) {
60-
throw new \LogicException(sprintf('You must set the KERNEL_CLASS environment variable to the fully-qualified class name of your Kernel in phpunit.xml / phpunit.xml.dist or override the %1$s::createKernel() or %1$s::getKernelClass() method.', static::class));
60+
throw new \LogicException(sprintf('You must set the KERNEL_CLASS environment variable to the fully-qualified class name of your Kernel in phpunit.xml / phpunit.xml.dist or override the "%1$s::createKernel()" or "%1$s::getKernelClass()" method.', static::class));
6161
}
6262

6363
if (!class_exists($class = $_ENV['KERNEL_CLASS'] ?? $_SERVER['KERNEL_CLASS'])) {
64-
throw new \RuntimeException(sprintf('Class "%s" doesn\'t exist or cannot be autoloaded. Check that the KERNEL_CLASS value in phpunit.xml matches the fully-qualified class name of your Kernel or override the %s::createKernel() method.', $class, static::class));
64+
throw new \RuntimeException(sprintf('Class "%s" doesn\'t exist or cannot be autoloaded. Check that the KERNEL_CLASS value in phpunit.xml matches the fully-qualified class name of your Kernel or override the "%s::createKernel()" method.', $class, static::class));
6565
}
6666

6767
return $class;

Tests/Controller/AbstractControllerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ public function setContainer(ContainerInterface $container): ?ContainerInterface
106106
continue;
107107
}
108108
if (!isset($expected[$id])) {
109-
throw new \UnexpectedValueException(sprintf('Service "%s" is not expected, as declared by %s::getSubscribedServices()', $id, AbstractController::class));
109+
throw new \UnexpectedValueException(sprintf('Service "%s" is not expected, as declared by "%s::getSubscribedServices()".', $id, AbstractController::class));
110110
}
111111
$type = substr($expected[$id], 1);
112112
if (!$container->get($id) instanceof $type) {
113-
throw new \UnexpectedValueException(sprintf('Service "%s" is expected to be an instance of "%s", as declared by %s::getSubscribedServices()', $id, $type, AbstractController::class));
113+
throw new \UnexpectedValueException(sprintf('Service "%s" is expected to be an instance of "%s", as declared by "%s::getSubscribedServices()".', $id, $type, AbstractController::class));
114114
}
115115
}
116116

Tests/Routing/RouterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public function testExceptionOnNonExistentParameterWithSfContainer()
390390
public function testExceptionOnNonStringParameter()
391391
{
392392
$this->expectException('Symfony\Component\DependencyInjection\Exception\RuntimeException');
393-
$this->expectExceptionMessage('The container parameter "object", used in the route configuration value "/%object%", must be a string or numeric, but it is of type object.');
393+
$this->expectExceptionMessage('The container parameter "object", used in the route configuration value "/%object%", must be a string or numeric, but it is of type "object".');
394394
$routes = new RouteCollection();
395395

396396
$routes->add('foo', new Route('/%object%'));

0 commit comments

Comments
 (0)