Skip to content

Commit a9c7aba

Browse files
committed
proofread comments in voter article
1 parent bde40f9 commit a9c7aba

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cookbook/security/voters.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ edit a particular object. Here's an example implementation::
104104
*/
105105
public function vote(TokenInterface $token, $post, array $attributes)
106106
{
107-
// check if class of this object is supported by this voter
107+
// check if the class of this object is supported by this voter
108108
if (!$this->supportsClass(get_class($post))) {
109109
return VoterInterface::ACCESS_ABSTAIN;
110110
}
111111

112-
// check if the voter is used correct, only allow one attribute
112+
// check if the voter is used correctly, only allow one attribute
113113
// this isn't a requirement, it's just one easy way for you to
114114
// design your voter
115115
if (1 !== count($attributes)) {
@@ -134,9 +134,9 @@ edit a particular object. Here's an example implementation::
134134
return VoterInterface::ACCESS_DENIED;
135135
}
136136

137-
// double-check that the User object is the expected entity.
138-
// It always will be, unless there is some misconfiguration of the
139-
// security system.
137+
// double-check that the User object is the expected entity
138+
// it always will be unless there is some misconfiguration of the
139+
// security system
140140
if (!$user instanceof User) {
141141
throw new \LogicException('The user is somehow not our User class!');
142142
}
@@ -196,7 +196,8 @@ and tag it with ``security.voter``:
196196
<services>
197197
<service id="security.access.post_voter"
198198
class="AppBundle\Security\Authorization\Voter\PostVoter"
199-
public="false">
199+
public="false"
200+
>
200201
201202
<tag name="security.voter" />
202203
</service>
@@ -238,7 +239,7 @@ from the security context is called.
238239
// get a Post instance
239240
$post = ...;
240241
241-
// keep in mind, this will call all registered security voters
242+
// keep in mind that this will call all registered security voters
242243
if (false === $this->get('security.context')->isGranted('view', $post)) {
243244
throw new AccessDeniedException('Unauthorized access!');
244245
}

0 commit comments

Comments
 (0)