diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2011-12-18 14:48:17 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2011-12-18 14:48:17 +0100 |
commit | c65b37ce9b93a1bbfc6f33a41e834ff080d24c0f (patch) | |
tree | 2f22d35b8b615c348b29b64f8707435d2d306db9 /Acl | |
parent | 60fe04c4834d8a734b2902ceddf7bbe2ac3d0bcd (diff) | |
parent | 1df44a7f54710ec4f270e7398bf1908af8f8ada8 (diff) | |
download | symfony-security-c65b37ce9b93a1bbfc6f33a41e834ff080d24c0f.zip symfony-security-c65b37ce9b93a1bbfc6f33a41e834ff080d24c0f.tar.gz symfony-security-c65b37ce9b93a1bbfc6f33a41e834ff080d24c0f.tar.bz2 |
merged 2.0
Diffstat (limited to 'Acl')
-rw-r--r-- | Acl/Dbal/AclProvider.php | 2 | ||||
-rw-r--r-- | Acl/Dbal/MutableAclProvider.php | 4 | ||||
-rw-r--r-- | Acl/Domain/AuditLogger.php | 2 | ||||
-rw-r--r-- | Acl/Domain/ObjectIdentity.php | 2 | ||||
-rw-r--r-- | Acl/Domain/PermissionGrantingStrategy.php | 4 | ||||
-rw-r--r-- | Acl/Domain/SecurityIdentityRetrievalStrategy.php | 4 | ||||
-rw-r--r-- | Acl/Permission/MaskBuilder.php | 4 | ||||
-rw-r--r-- | Acl/Voter/AclVoter.php | 6 |
8 files changed, 14 insertions, 14 deletions
diff --git a/Acl/Dbal/AclProvider.php b/Acl/Dbal/AclProvider.php index e57929e..8413843 100644 --- a/Acl/Dbal/AclProvider.php +++ b/Acl/Dbal/AclProvider.php @@ -494,7 +494,7 @@ QUERY; $acl = $acls[$aclId]; // has the ACL been hydrated during any previous cycle, or was possibly loaded // from cache? - } else if (isset($loadedAcls[$classType][$objectIdentifier])) { + } elseif (isset($loadedAcls[$classType][$objectIdentifier])) { $acl = $loadedAcls[$classType][$objectIdentifier]; // keep reference in local array (saves us some hash calculations) diff --git a/Acl/Dbal/MutableAclProvider.php b/Acl/Dbal/MutableAclProvider.php index f1c5e08..3ae08d3 100644 --- a/Acl/Dbal/MutableAclProvider.php +++ b/Acl/Dbal/MutableAclProvider.php @@ -511,7 +511,7 @@ QUERY; if ($sid instanceof UserSecurityIdentity) { $identifier = $sid->getClass().'-'.$sid->getUsername(); $username = true; - } else if ($sid instanceof RoleSecurityIdentity) { + } elseif ($sid instanceof RoleSecurityIdentity) { $identifier = $sid->getRole(); $username = false; } else { @@ -579,7 +579,7 @@ QUERY; if ($sid instanceof UserSecurityIdentity) { $identifier = $sid->getClass().'-'.$sid->getUsername(); $username = true; - } else if ($sid instanceof RoleSecurityIdentity) { + } elseif ($sid instanceof RoleSecurityIdentity) { $identifier = $sid->getRole(); $username = false; } else { diff --git a/Acl/Domain/AuditLogger.php b/Acl/Domain/AuditLogger.php index fa91b60..8174873 100644 --- a/Acl/Domain/AuditLogger.php +++ b/Acl/Domain/AuditLogger.php @@ -36,7 +36,7 @@ abstract class AuditLogger implements AuditLoggerInterface if ($granted && $ace->isAuditSuccess()) { $this->doLog($granted, $ace); - } else if (!$granted && $ace->isAuditFailure()) { + } elseif (!$granted && $ace->isAuditFailure()) { $this->doLog($granted, $ace); } } diff --git a/Acl/Domain/ObjectIdentity.php b/Acl/Domain/ObjectIdentity.php index ee2fafc..2bd152a 100644 --- a/Acl/Domain/ObjectIdentity.php +++ b/Acl/Domain/ObjectIdentity.php @@ -60,7 +60,7 @@ final class ObjectIdentity implements ObjectIdentityInterface try { if ($domainObject instanceof DomainObjectInterface) { return new self($domainObject->getObjectIdentifier(), get_class($domainObject)); - } else if (method_exists($domainObject, 'getId')) { + } elseif (method_exists($domainObject, 'getId')) { return new self($domainObject->getId(), get_class($domainObject)); } } catch (\InvalidArgumentException $invalid) { diff --git a/Acl/Domain/PermissionGrantingStrategy.php b/Acl/Domain/PermissionGrantingStrategy.php index 152b704..c34db2a 100644 --- a/Acl/Domain/PermissionGrantingStrategy.php +++ b/Acl/Domain/PermissionGrantingStrategy.php @@ -196,9 +196,9 @@ class PermissionGrantingStrategy implements PermissionGrantingStrategyInterface $strategy = $ace->getStrategy(); if (self::ALL === $strategy) { return $requiredMask === ($ace->getMask() & $requiredMask); - } else if (self::ANY === $strategy) { + } elseif (self::ANY === $strategy) { return 0 !== ($ace->getMask() & $requiredMask); - } else if (self::EQUAL === $strategy) { + } elseif (self::EQUAL === $strategy) { return $requiredMask === $ace->getMask(); } diff --git a/Acl/Domain/SecurityIdentityRetrievalStrategy.php b/Acl/Domain/SecurityIdentityRetrievalStrategy.php index 70b6d90..dbc0530 100644 --- a/Acl/Domain/SecurityIdentityRetrievalStrategy.php +++ b/Acl/Domain/SecurityIdentityRetrievalStrategy.php @@ -67,10 +67,10 @@ class SecurityIdentityRetrievalStrategy implements SecurityIdentityRetrievalStra $sids[] = new RoleSecurityIdentity(AuthenticatedVoter::IS_AUTHENTICATED_FULLY); $sids[] = new RoleSecurityIdentity(AuthenticatedVoter::IS_AUTHENTICATED_REMEMBERED); $sids[] = new RoleSecurityIdentity(AuthenticatedVoter::IS_AUTHENTICATED_ANONYMOUSLY); - } else if ($this->authenticationTrustResolver->isRememberMe($token)) { + } elseif ($this->authenticationTrustResolver->isRememberMe($token)) { $sids[] = new RoleSecurityIdentity(AuthenticatedVoter::IS_AUTHENTICATED_REMEMBERED); $sids[] = new RoleSecurityIdentity(AuthenticatedVoter::IS_AUTHENTICATED_ANONYMOUSLY); - } else if ($this->authenticationTrustResolver->isAnonymous($token)) { + } elseif ($this->authenticationTrustResolver->isAnonymous($token)) { $sids[] = new RoleSecurityIdentity(AuthenticatedVoter::IS_AUTHENTICATED_ANONYMOUSLY); } diff --git a/Acl/Permission/MaskBuilder.php b/Acl/Permission/MaskBuilder.php index e81005b..44ee274 100644 --- a/Acl/Permission/MaskBuilder.php +++ b/Acl/Permission/MaskBuilder.php @@ -93,7 +93,7 @@ class MaskBuilder { if (is_string($mask) && defined($name = 'static::MASK_'.strtoupper($mask))) { $mask = constant($name); - } else if (!is_int($mask)) { + } elseif (!is_int($mask)) { throw new \InvalidArgumentException('$mask must be an integer.'); } @@ -146,7 +146,7 @@ class MaskBuilder { if (is_string($mask) && defined($name = 'static::MASK_'.strtoupper($mask))) { $mask = constant($name); - } else if (!is_int($mask)) { + } elseif (!is_int($mask)) { throw new \InvalidArgumentException('$mask must be an integer.'); } diff --git a/Acl/Voter/AclVoter.php b/Acl/Voter/AclVoter.php index d9e8c03..456c434 100644 --- a/Acl/Voter/AclVoter.php +++ b/Acl/Voter/AclVoter.php @@ -64,7 +64,7 @@ class AclVoter implements VoterInterface } return $this->allowIfObjectIdentityUnavailable ? self::ACCESS_GRANTED : self::ACCESS_ABSTAIN; - } else if ($object instanceof FieldVote) { + } elseif ($object instanceof FieldVote) { $field = $object->getField(); $object = $object->getDomainObject(); } else { @@ -73,7 +73,7 @@ class AclVoter implements VoterInterface if ($object instanceof ObjectIdentityInterface) { $oid = $object; - } else if (null === $oid = $this->objectIdentityRetrievalStrategy->getObjectIdentity($object)) { + } elseif (null === $oid = $this->objectIdentityRetrievalStrategy->getObjectIdentity($object)) { if (null !== $this->logger) { $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); } @@ -96,7 +96,7 @@ class AclVoter implements VoterInterface } return self::ACCESS_GRANTED; - } else if (null !== $field && $acl->isFieldGranted($field, $masks, $sids, false)) { + } elseif (null !== $field && $acl->isFieldGranted($field, $masks, $sids, false)) { if (null !== $this->logger) { $this->logger->debug('ACL found, permission granted. Voting to grant access'); } |