Browse Source

changed condition nesting

Johannes Schmitt 14 years ago
parent
commit
031bf35bb1
1 changed files with 2 additions and 6 deletions
  1. 2 6
      src/Symfony/Component/Security/Acl/Voter/AclVoter.php

+ 2 - 6
src/Symfony/Component/Security/Acl/Voter/AclVoter.php

@@ -78,14 +78,10 @@ class AclVoter implements VoterInterface
                 } else {
                 } else {
                     $field = null;
                     $field = null;
                 }
                 }
-                
+
                 if ($object instanceof ObjectIdentityInterface) {
                 if ($object instanceof ObjectIdentityInterface) {
                     $oid = $object;
                     $oid = $object;
-                } else {
-                    $oid = $this->objectIdentityRetrievalStrategy->getObjectIdentity($object);
-                }
-
-                if (null === $oid) {
+                } else if (null === $oid = $this->objectIdentityRetrievalStrategy->getObjectIdentity($object)) {
                     if (null !== $this->logger) {
                     if (null !== $this->logger) {
                         $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain'));
                         $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain'));
                     }
                     }