Skip to content

Commit 88bf10f

Browse files
committed
Fix quotes in exception messages
1 parent 895d728 commit 88bf10f

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

DataCollector/SecurityDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function collect(Request $request, Response $response, \Exception $except
121121

122122
$extractRoles = function ($role) {
123123
if (!$role instanceof RoleInterface && !$role instanceof Role) {
124-
throw new \InvalidArgumentException(sprintf('Roles must be instances of %s or %s (%s given).', RoleInterface::class, Role::class, \is_object($role) ? \get_class($role) : \gettype($role)));
124+
throw new \InvalidArgumentException(sprintf('Roles must be instances of "%s" or "%s" ("%s" given).', RoleInterface::class, Role::class, \is_object($role) ? \get_class($role) : \gettype($role)));
125125
}
126126

127127
return $role->getRole();

DependencyInjection/Compiler/AddSecurityVotersPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function process(ContainerBuilder $container)
5151

5252
if (!method_exists($class, 'vote')) {
5353
// in case the vote method is completely missing, to prevent exceptions when voting
54-
throw new LogicException(sprintf('%s should implement the %s interface when used as voter.', $class, VoterInterface::class));
54+
throw new LogicException(sprintf('"%s" should implement the "%s" interface when used as voter.', $class, VoterInterface::class));
5555
}
5656
}
5757

Security/FirewallContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct($listeners, ExceptionListener $exceptionListener = n
4141
$this->logoutListener = $logoutListener;
4242
$this->config = $config;
4343
} else {
44-
throw new \InvalidArgumentException(sprintf('Argument 3 passed to %s() must be instance of %s or null, %s given.', __METHOD__, LogoutListener::class, \is_object($logoutListener) ? \get_class($logoutListener) : \gettype($logoutListener)));
44+
throw new \InvalidArgumentException(sprintf('Argument 3 passed to "%s()" must be instance of "%s" or null, "%s" given.', __METHOD__, LogoutListener::class, \is_object($logoutListener) ? \get_class($logoutListener) : \gettype($logoutListener)));
4545
}
4646
}
4747

Tests/DependencyInjection/Compiler/AddSecurityVotersPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function testVoterMissingInterface()
9797
public function testVoterMissingInterfaceAndMethod()
9898
{
9999
$exception = LogicException::class;
100-
$message = 'stdClass should implement the Symfony\Component\Security\Core\Authorization\Voter\VoterInterface interface when used as voter.';
100+
$message = '"stdClass" should implement the "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface" interface when used as voter.';
101101

102102
$this->expectException($exception);
103103
$this->expectExceptionMessage($message);

0 commit comments

Comments
 (0)