Skip to content

Commit 4d1de98

Browse files
committed
proofread comments in voter article
1 parent c544f05 commit 4d1de98

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cookbook/security/voters.rst

Lines changed: 7 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,8 @@ 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 (this
138+
// only happens when you did not configure the security system properly)
140139
if (!$user instanceof User) {
141140
throw new \LogicException('The user is somehow not our User class!');
142141
}
@@ -196,7 +195,8 @@ and tag it with ``security.voter``:
196195
<services>
197196
<service id="security.access.post_voter"
198197
class="AppBundle\Security\Authorization\Voter\PostVoter"
199-
public="false">
198+
public="false"
199+
>
200200
201201
<tag name="security.voter" />
202202
</service>
@@ -238,7 +238,7 @@ from the security context is called.
238238
// get a Post instance
239239
$post = ...;
240240
241-
// keep in mind, this will call all registered security voters
241+
// keep in mind that this will call all registered security voters
242242
if (false === $this->get('security.context')->isGranted('view', $post)) {
243243
throw new AccessDeniedException('Unauthorized access!');
244244
}

0 commit comments

Comments
 (0)