You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/Voter/AbstractVoter.php
+6-24
Original file line number
Diff line number
Diff line change
@@ -68,10 +68,9 @@ public function vote(TokenInterface $token, $object, array $attributes)
68
68
69
69
// abstain vote by default in case none of the attributes are supported
70
70
$vote = self::ACCESS_ABSTAIN;
71
-
$class = get_class($object);
72
71
73
72
foreach ($attributesas$attribute) {
74
-
if (!$this->supports($attribute, $class)) {
73
+
if (!$this->supports($attribute, $object)) {
75
74
continue;
76
75
}
77
76
@@ -88,25 +87,22 @@ public function vote(TokenInterface $token, $object, array $attributes)
88
87
}
89
88
90
89
/**
91
-
* Determines if the attribute and class are supported by this voter.
92
-
*
93
-
* To determine if the passed class is instance of the supported class, the
94
-
* isClassInstanceOf() method can be used.
90
+
* Determines if the attribute and object are supported by this voter.
95
91
*
96
92
* This method will become abstract in 3.0.
97
93
*
98
94
* @param string $attribute An attribute
99
-
* @param string $classThe fully qualified class name of the passed object
95
+
* @param string $object The object to secure
100
96
*
101
-
* @return bool True if the attribute and class is supported, false otherwise
97
+
* @return bool True if the attribute and object is supported, false otherwise
102
98
*/
103
-
protectedfunctionsupports($attribute, $class)
99
+
protectedfunctionsupports($attribute, $object)
104
100
{
105
101
@trigger_error('The getSupportedClasses and getSupportedAttributes methods are deprecated since version 2.8 and will be removed in version 3.0. Overwrite supports instead.', E_USER_DEPRECATED);
0 commit comments