8000 document method name changes in Voter class · symfony/symfony@d3598b1 · GitHub
[go: up one dir, main page]

Skip to content

Commit d3598b1

Browse files
committed
document method name changes in Voter class
1 parent e617502 commit d3598b1

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

UPGRADE-3.0.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,39 @@ UPGRADE FROM 2.x to 3.0
10401040
}
10411041
```
10421042

1043+
* The `AbstractVoter::isGranted()` method have been replaced by `Voter::voteOnAttribute()`.
1044+
1045+
Before:
1046+
1047+
```php
1048+
class MyVoter extends AbstractVoter
1049+
{
1050+
protected function isGranted($attribute, $object, $user = null)
1051+
{
1052+
return 'EDIT' === $attribute && $user === $object->getAuthor();
1053+
}
1054+
1055+
// ...
1056+
}
1057+
```
1058+
1059+
After:
1060+
1061+
```php
1062+
class MyVoter extends Voter
1063+
{
1064+
protected function voteOnAttribute($attribute, $object, TokenInterface $token)
1065+
{
1066+
return 'EDIT' === $attribute && $token->getUser() === $object->getAuthor();
1067+
}
1068+
1069+
// ...
1070+
}
1071+
```
1072+
1073+
* The `supportsAttribute()` and `supportsClass()` methods of classes `AuthenticatedVoter`, `ExpressionVoter`
1074+
and `RoleVoter` have been removed.
1075+
10431076
* The `intention` option was renamed to `csrf_token_id` for all the authentication listeners.
10441077

10451078
* The `csrf_provider` option was renamed to `csrf_token_generator` for all the authentication listeners.

0 commit comments

Comments
 (0)
0