Skip to content

Commit f98a05c

Browse files
committed
Deprecated supportsAttribute and supportsClass methods
1 parent 03e96d2 commit f98a05c

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

src/Symfony/Component/Security/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
CHANGELOG
22
=========
33

4+
2.8.0
5+
-----
6+
7+
* deprecated `supportsAttribute()` and `supportsClass()` attributes of
8+
`Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface` and
9+
`Symfony\Component\Security\Core\Authorization\Voter\VoterInterface`.
10+
411
2.7.0
512
-----
613

src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ public function decide(TokenInterface $token, array $attributes, $object = null)
7777
*/
7878
public function supportsAttribute($attribute)
7979
{
80+
@trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.');
81+
8082
foreach ($this->voters as $voter) {
8183
if ($voter->supportsAttribute($attribute)) {
8284
return true;
@@ -91,6 +93,8 @@ public function supportsAttribute($attribute)
9193
*/
9294
public function supportsClass($class)
9395
{
96+
@trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.');
97+
9498
foreach ($this->voters as $voter) {
9599
if ($voter->supportsClass($class)) {
96100
return true;

src/Symfony/Component/Security/Core/Authorization/AccessDecisionManagerInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public function decide(TokenInterface $token, array $attributes, $object = null)
3737
* @param string $attribute An attribute
3838
*
3939
* @return bool true if this decision manager supports the attribute, false otherwise
40+
*
41+
* @deprecated since version 2.8, to be removed in 3.0.
4042
*/
4143
public function supportsAttribute($attribute);
4244

@@ -46,6 +48,8 @@ public function supportsAttribute($attribute);
4648
* @param string $class A class name
4749
*
4850
* @return true if this decision manager can process the class
51+
*
52+
* @deprecated since version 2.8, to be removed in 3.0.
4953
*/
5054
public function supportsClass($class);
5155
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ interface VoterInterface
3030
* @param string $attribute An attribute
3131
*
3232
* @return bool true if this Voter supports the attribute, false otherwise
33+
*
34+
* @deprecated since version 2.8, to be removed in 3.0.
3335
*/
3436
public function supportsAttribute($attribute);
3537

@@ -39,6 +41,8 @@ public function supportsAttribute($attribute);
3941
* @param string $class A class name
4042
*
4143
* @return bool true if this Voter can process the class
44+
*
45+
* @deprecated since version 2.8, to be removed in 3.0.
4246
*/
4347
public function supportsClass($class);
4448

src/Symfony/Component/Security/Core/Tests/Authorization/AccessDecisionManagerTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase
1818
{
19+
/**
20+
* @group legacy
21+
*/
1922
public function testSupportsClass()
2023
{
2124
$manager = new AccessDecisionManager(array(
@@ -31,6 +34,9 @@ public function testSupportsClass()
3134
$this->assertFalse($manager->supportsClass('FooClass'));
3235
}
3336

37+
/**
38+
* @group legacy
39+
*/
3440
public function testSupportsAttribute()
3541
{
3642
$manager = new AccessDecisionManager(array(

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