Skip to content

Commit

Permalink
Deprecated Security ClassUtils in favor of Acl ClassUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
Iltar van der Berg committed Aug 27, 2015
1 parent bab9ac5 commit 4278fe4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Symfony/Component/Security/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ CHANGELOG
`Symfony\Component\Security\Http\Authentication\SimplePreAuthenticatorInterface` instead
* deprecated `Symfony\Component\Security\Core\Authentication\SimpleFormAuthenticatorInterface`, use
`Symfony\Component\Security\Http\Authentication\SimpleFormAuthenticatorInterface` instead
* deprecated `Symfony\Component\Security\Core\Util\ClassUtils`, use
`Symfony\Component\Security\Acl\Util\ClassUtils` instead

2.7.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
{
use Symfony\Component\Security\Core\Util\ClassUtils;

/**
* @group legacy
*/
class ClassUtilsTest extends \PHPUnit_Framework_TestCase
{
public static function dataGetClass()
Expand Down
11 changes: 9 additions & 2 deletions src/Symfony/Component/Security/Core/Util/ClassUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@

namespace Symfony\Component\Security\Core\Util;

use Doctrine\Common\Util\ClassUtils as DoctrineClassUtils;
use Symfony\Component\Security\Acl\Util\ClassUtils as AclClassUtils;

@trigger_error('The '.__NAMESPACE__.'\ClassUtils class is deprecated since version 2.8, to be removed in 3.0. Use Symfony\Component\Security\Acl\Util\ClassUtils instead.', E_USER_DEPRECATED);

/**
* Class related functionality for objects that
* might or might not be proxy objects at the moment.
*
* @see DoctrineClassUtils
* @deprecated ClassUtils is deprecated since version 2.8, to be removed in 3.0. Use Acl ClassUtils instead.
*
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Johannes Schmitt <schmittjoh@gmail.com>
Expand Down Expand Up @@ -54,6 +56,11 @@ private function __construct()
*/
public static function getRealClass($object)
{
if (class_exists('Symfony\Component\Security\Acl\Util\ClassUtils')) {
return AclClassUtils::getRealClass($object);
}

// fallback in case security-acl is not installed
$class = is_object($object) ? get_class($object) : $object;

if (false === $pos = strrpos($class, '\\'.self::MARKER.'\\')) {
Expand Down

0 comments on commit 4278fe4

Please sign in to comment.