Skip to content

Commit a7612b1

Browse files
committed
Some minor tweaks based on suggestions from stof in symfony#15870
1 parent 1d5557f commit a7612b1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Symfony/Component/Security/Core/Authorization/Voter/AbstractVoter.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ public function vote(TokenInterface $token, $object, array $attributes)
7171
$class = get_class($object);
7272

7373
$reflector = new \ReflectionMethod($this, 'voteOnAttribute');
74-
$isNewOverwritten = $reflector->getDeclaringClass()->getName() !== 'Symfony\Component\Security\Core\Authorization\Voter\AbstractVoter';
74+
$isNewOverwritten = $reflector->getDeclaringClass()->getName() !== __CLASS__;
7575
if (!$isNewOverwritten) {
76-
@trigger_error(sprintf("The AbstractVoter::isGranted method is deprecated since 2.8 and won't be called anymore in 3.0. Override voteOnAttribute() instead.", $reflector->class), E_USER_DEPRECATED);
76+
@trigger_error(sprintf("The AbstractVoter::isGranted method is deprecated since 2.8 and won't be called anymore in 3.0. Override voteOnAttribute() in %s instead.", $reflector->class, get_class($this)), E_USER_DEPRECATED);
7777
}
7878

7979
foreach ($attributes as $attribute) {
@@ -191,6 +191,9 @@ protected function getSupportedAttributes()
191191
*/
192192
protected function isGranted($attribute, $object, $user = null)
193193
{
194+
// in case someone calls this directly
195+
@trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.');
196+
194197
return false;
195198
}
196199

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy