diff options
Diffstat (limited to 'Acl/Domain')
-rw-r--r-- | Acl/Domain/Acl.php | 16 | ||||
-rw-r--r-- | Acl/Domain/AclCollectionCache.php | 8 | ||||
-rw-r--r-- | Acl/Domain/AuditLogger.php | 2 | ||||
-rw-r--r-- | Acl/Domain/DoctrineAclCache.php | 2 | ||||
-rw-r--r-- | Acl/Domain/Entry.php | 5 | ||||
-rw-r--r-- | Acl/Domain/FieldEntry.php | 1 | ||||
-rw-r--r-- | Acl/Domain/ObjectIdentity.php | 6 | ||||
-rw-r--r-- | Acl/Domain/PermissionGrantingStrategy.php | 2 | ||||
-rw-r--r-- | Acl/Domain/RoleSecurityIdentity.php | 1 | ||||
-rw-r--r-- | Acl/Domain/SecurityIdentityRetrievalStrategy.php | 2 | ||||
-rw-r--r-- | Acl/Domain/UserSecurityIdentity.php | 5 |
11 files changed, 11 insertions, 39 deletions
diff --git a/Acl/Domain/Acl.php b/Acl/Domain/Acl.php index 32b0faf..4665c0e 100644 --- a/Acl/Domain/Acl.php +++ b/Acl/Domain/Acl.php @@ -54,7 +54,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param PermissionGrantingStrategyInterface $permissionGrantingStrategy * @param array $loadedSids * @param Boolean $entriesInheriting - * @return void */ public function __construct($id, ObjectIdentityInterface $objectIdentity, PermissionGrantingStrategyInterface $permissionGrantingStrategy, array $loadedSids = array(), $entriesInheriting) { @@ -75,7 +74,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * Adds a property changed listener * * @param PropertyChangedListener $listener - * @return void */ public function addPropertyChangedListener(PropertyChangedListener $listener) { @@ -281,7 +279,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * Implementation for the \Serializable interface * * @param string $serialized - * @return void */ public function unserialize($serialized) { @@ -313,9 +310,9 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged /** * {@inheritDoc} */ - public function setParentAcl(AclInterface $acl) + public function setParentAcl(AclInterface $acl = null) { - if (null === $acl->getId()) { + if (null !== $acl && null === $acl->getId()) { throw new \InvalidArgumentException('$acl must have an ID.'); } @@ -403,7 +400,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param string $property * @param integer $index * @throws \OutOfBoundsException - * @return void */ private function deleteAce($property, $index) { @@ -429,7 +425,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param integer $index * @param string $field * @throws \OutOfBoundsException - * @return void */ private function deleteFieldAce($property, $index, $field) { @@ -459,7 +454,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param string $strategy * @throws \OutOfBoundsException * @throws \InvalidArgumentException - * @return void */ private function insertAce($property, $index, $mask, SecurityIdentityInterface $sid, $granting, $strategy = null) { @@ -509,7 +503,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param string $strategy * @throws \InvalidArgumentException * @throws \OutOfBoundsException - * @return void */ private function insertFieldAce($property, $index, $field, $mask, SecurityIdentityInterface $sid, $granting, $strategy = null) { @@ -563,7 +556,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param integer $mask * @param string $strategy * @throws \OutOfBoundsException - * @return void */ private function updateAce($property, $index, $mask, $strategy = null) { @@ -591,7 +583,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param Boolean $auditSuccess * @param Boolean $auditFailure * @throws \OutOfBoundsException - * @return void */ private function updateAuditing(array &$aces, $index, $auditSuccess, $auditFailure) { @@ -620,7 +611,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param string $strategy * @throws \InvalidArgumentException * @throws \OutOfBoundsException - * @return void */ private function updateFieldAce($property, $index, $field, $mask, $strategy = null) { @@ -650,7 +640,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param string $name * @param mixed $oldValue * @param mixed $newValue - * @return void */ private function onPropertyChanged($name, $oldValue, $newValue) { @@ -666,7 +655,6 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param string $name * @param mixed $oldValue * @param mixed $newValue - * @return void */ private function onEntryPropertyChanged(EntryInterface $entry, $name, $oldValue, $newValue) { diff --git a/Acl/Domain/AclCollectionCache.php b/Acl/Domain/AclCollectionCache.php index 12d7053..88c017c 100644 --- a/Acl/Domain/AclCollectionCache.php +++ b/Acl/Domain/AclCollectionCache.php @@ -29,10 +29,9 @@ class AclCollectionCache /** * Constructor. * - * @param AclProviderInterface $aclProvider - * @param ObjectIdentityRetrievalStrategy $oidRetrievalStrategy - * @param SecurityIdentityRetrievalStrategy $sidRetrievalStrategy - * @return void + * @param AclProviderInterface $aclProvider + * @param ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy + * @param SecurityIdentityRetrievalStrategyInterface $sidRetrievalStrategy */ public function __construct(AclProviderInterface $aclProvider, ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy, SecurityIdentityRetrievalStrategyInterface $sidRetrievalStrategy) { @@ -47,7 +46,6 @@ class AclCollectionCache * * @param mixed $collection anything that can be passed to foreach() * @param array $tokens an array of TokenInterface implementations - * @return void */ public function cache($collection, array $tokens = array()) { diff --git a/Acl/Domain/AuditLogger.php b/Acl/Domain/AuditLogger.php index 2a6461c..8174873 100644 --- a/Acl/Domain/AuditLogger.php +++ b/Acl/Domain/AuditLogger.php @@ -27,7 +27,6 @@ abstract class AuditLogger implements AuditLoggerInterface * * @param Boolean $granted * @param EntryInterface $ace - * @return void */ public function logIfNeeded($granted, EntryInterface $ace) { @@ -47,7 +46,6 @@ abstract class AuditLogger implements AuditLoggerInterface * * @param Boolean $granted * @param EntryInterface $ace - * @return void */ abstract protected function doLog($granted, EntryInterface $ace); } diff --git a/Acl/Domain/DoctrineAclCache.php b/Acl/Domain/DoctrineAclCache.php index 21e5149..731f98c 100644 --- a/Acl/Domain/DoctrineAclCache.php +++ b/Acl/Domain/DoctrineAclCache.php @@ -36,8 +36,6 @@ class DoctrineAclCache implements AclCacheInterface * @param Cache $cache * @param PermissionGrantingStrategyInterface $permissionGrantingStrategy * @param string $prefix - * - * @return void */ public function __construct(Cache $cache, PermissionGrantingStrategyInterface $permissionGrantingStrategy, $prefix = self::PREFIX) { diff --git a/Acl/Domain/Entry.php b/Acl/Domain/Entry.php index 9a4f560..42449c4 100644 --- a/Acl/Domain/Entry.php +++ b/Acl/Domain/Entry.php @@ -126,7 +126,6 @@ class Entry implements AuditableEntryInterface * AclInterface instead. * * @param Boolean $boolean - * @return void */ public function setAuditFailure($boolean) { @@ -140,7 +139,6 @@ class Entry implements AuditableEntryInterface * AclInterface instead. * * @param Boolean $boolean - * @return void */ public function setAuditSuccess($boolean) { @@ -154,7 +152,6 @@ class Entry implements AuditableEntryInterface * AclInterface instead. * * @param integer $mask - * @return void */ public function setMask($mask) { @@ -168,7 +165,6 @@ class Entry implements AuditableEntryInterface * AclInterface instead. * * @param string $strategy - * @return void */ public function setStrategy($strategy) { @@ -197,7 +193,6 @@ class Entry implements AuditableEntryInterface * Implementation of \Serializable * * @param string $serialized - * @return void */ public function unserialize($serialized) { diff --git a/Acl/Domain/FieldEntry.php b/Acl/Domain/FieldEntry.php index 4167ba4..f057367 100644 --- a/Acl/Domain/FieldEntry.php +++ b/Acl/Domain/FieldEntry.php @@ -36,7 +36,6 @@ class FieldEntry extends Entry implements FieldEntryInterface * @param Boolean $granting * @param Boolean $auditFailure * @param Boolean $auditSuccess - * @return void */ public function __construct($id, AclInterface $acl, $field, SecurityIdentityInterface $sid, $strategy, $mask, $granting, $auditFailure, $auditSuccess) { diff --git a/Acl/Domain/ObjectIdentity.php b/Acl/Domain/ObjectIdentity.php index 927a1b8..da98f5e 100644 --- a/Acl/Domain/ObjectIdentity.php +++ b/Acl/Domain/ObjectIdentity.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Security\Acl\Domain; +use Symfony\Component\Security\Core\Util\ClassUtils; use Symfony\Component\Security\Acl\Exception\InvalidDomainObjectException; use Symfony\Component\Security\Acl\Model\DomainObjectInterface; use Symfony\Component\Security\Acl\Model\ObjectIdentityInterface; @@ -30,7 +31,6 @@ final class ObjectIdentity implements ObjectIdentityInterface * * @param string $identifier * @param string $type - * @return void */ public function __construct($identifier, $type) { @@ -60,9 +60,9 @@ final class ObjectIdentity implements ObjectIdentityInterface try { if ($domainObject instanceof DomainObjectInterface) { - return new self($domainObject->getObjectIdentifier(), get_class($domainObject)); + return new self($domainObject->getObjectIdentifier(), ClassUtils::getRealClass($domainObject)); } elseif (method_exists($domainObject, 'getId')) { - return new self($domainObject->getId(), get_class($domainObject)); + return new self($domainObject->getId(), ClassUtils::getRealClass($domainObject)); } } catch (\InvalidArgumentException $invalid) { throw new InvalidDomainObjectException($invalid->getMessage(), 0, $invalid); diff --git a/Acl/Domain/PermissionGrantingStrategy.php b/Acl/Domain/PermissionGrantingStrategy.php index b145ef3..09e227c 100644 --- a/Acl/Domain/PermissionGrantingStrategy.php +++ b/Acl/Domain/PermissionGrantingStrategy.php @@ -16,7 +16,6 @@ use Symfony\Component\Security\Acl\Model\AclInterface; use Symfony\Component\Security\Acl\Model\AuditLoggerInterface; use Symfony\Component\Security\Acl\Model\EntryInterface; use Symfony\Component\Security\Acl\Model\PermissionGrantingStrategyInterface; -use Symfony\Component\Security\Acl\Model\SecurityIdentityInterface; /** * The permission granting strategy to apply to the access control list. @@ -35,7 +34,6 @@ class PermissionGrantingStrategy implements PermissionGrantingStrategyInterface * Sets the audit logger * * @param AuditLoggerInterface $auditLogger - * @return void */ public function setAuditLogger(AuditLoggerInterface $auditLogger) { diff --git a/Acl/Domain/RoleSecurityIdentity.php b/Acl/Domain/RoleSecurityIdentity.php index 51d3d0c..0d3d0d2 100644 --- a/Acl/Domain/RoleSecurityIdentity.php +++ b/Acl/Domain/RoleSecurityIdentity.php @@ -27,7 +27,6 @@ final class RoleSecurityIdentity implements SecurityIdentityInterface * Constructor * * @param mixed $role a Role instance, or its string representation - * @return void */ public function __construct($role) { diff --git a/Acl/Domain/SecurityIdentityRetrievalStrategy.php b/Acl/Domain/SecurityIdentityRetrievalStrategy.php index 67312b2..dbc0530 100644 --- a/Acl/Domain/SecurityIdentityRetrievalStrategy.php +++ b/Acl/Domain/SecurityIdentityRetrievalStrategy.php @@ -34,8 +34,6 @@ class SecurityIdentityRetrievalStrategy implements SecurityIdentityRetrievalStra * * @param RoleHierarchyInterface $roleHierarchy * @param AuthenticationTrustResolver $authenticationTrustResolver - * - * @return void */ public function __construct(RoleHierarchyInterface $roleHierarchy, AuthenticationTrustResolver $authenticationTrustResolver) { diff --git a/Acl/Domain/UserSecurityIdentity.php b/Acl/Domain/UserSecurityIdentity.php index 34051e8..ebb0056 100644 --- a/Acl/Domain/UserSecurityIdentity.php +++ b/Acl/Domain/UserSecurityIdentity.php @@ -13,6 +13,7 @@ namespace Symfony\Component\Security\Acl\Domain; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\User\UserInterface; +use Symfony\Component\Security\Core\Util\ClassUtils; use Symfony\Component\Security\Acl\Model\SecurityIdentityInterface; /** @@ -52,7 +53,7 @@ final class UserSecurityIdentity implements SecurityIdentityInterface */ public static function fromAccount(UserInterface $user) { - return new self($user->getUsername(), get_class($user)); + return new self($user->getUsername(), ClassUtils::getRealClass($user)); } /** @@ -69,7 +70,7 @@ final class UserSecurityIdentity implements SecurityIdentityInterface return self::fromAccount($user); } - return new self((string) $user, is_object($user)? get_class($user) : get_class($token)); + return new self((string) $user, is_object($user) ? ClassUtils::getRealClass($user) : ClassUtils::getRealClass($token)); } /** |