Skip to content

Commit 3d8f680

Browse files
committed
Fix quotes in exception messages
1 parent 6aac5d5 commit 3d8f680

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Authentication/Token/AbstractToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(array $roles = [])
4141
if (\is_string($role)) {
4242
$role = new Role($role);
4343
} elseif (!$role instanceof RoleInterface) {
44-
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings or Role instances, but got %s.', \gettype($role)));
44+
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings or Role instances, but got "%s".', \gettype($role)));
4545
}
4646

4747
$this->roles[] = $role;

Authorization/AccessDecisionManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct($voters = [], $strategy = self::STRATEGY_AFFIRMATIVE
6262
*/
6363
public function setVoters(array $voters)
6464
{
65-
@trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Pass the voters to the constructor instead.', __METHOD__), E_USER_DEPRECATED);
65+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Pass the voters to the constructor instead.', __METHOD__), E_USER_DEPRECATED);
6666

6767
$this->voters = $voters;
6868
}
@@ -197,6 +197,6 @@ private function vote($voter, TokenInterface $token, $subject, $attributes)
197197
return $voter->vote($token, $subject, $attributes);
198198
}
199199

200-
throw new LogicException(sprintf('%s should implement the %s interface when used as voter.', \get_class($voter), VoterInterface::class));
200+
throw new LogicException(sprintf('"%s" should implement the "%s" interface when used as voter.', \get_class($voter), VoterInterface::class));
201201
}
202202
}

Tests/Authorization/AccessDecisionManagerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ protected function getVoter($vote)
143143
public function testVotingWrongTypeNoVoteMethod()
144144
{
145145
$exception = LogicException::class;
146-
$message = sprintf('stdClass should implement the %s interface when used as voter.', VoterInterface::class);
146+
$message = sprintf('"stdClass" should implement the "%s" interface when used as voter.', VoterInterface::class);
147147

148148
$this->expectException($exception);
149149
$this->expectExceptionMessage($message);

0 commit comments

Comments
 (0)