Skip to content

Commit 8658634

Browse files
committed
do not construct Vote instances inside vote()
The so constructed objects will never be seen from the outside. Thus, adding reasons to them doesn't have an effect.
1 parent dc09373 commit 8658634

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tests/EventListener/IsGrantedAttributeListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ protected function supports(string $attribute, mixed $subject): bool
232232

233233
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token, ?Vote $vote = null): bool
234234
{
235-
$vote->reasons[] = 'Because I can 😈.';
235+
$vote?->addReason('Because I can 😈.');
236236

237237
return false;
238238
}

0 commit comments

Comments
 (0)