diff options
Diffstat (limited to 'Acl')
-rw-r--r-- | Acl/Dbal/AclProvider.php | 10 | ||||
-rw-r--r-- | Acl/Dbal/MutableAclProvider.php | 86 | ||||
-rw-r--r-- | Acl/Domain/Acl.php | 51 | ||||
-rw-r--r-- | Acl/Domain/DoctrineAclCache.php | 3 | ||||
-rw-r--r-- | Acl/Domain/Entry.php | 6 | ||||
-rw-r--r-- | Acl/Domain/ObjectIdentity.php | 2 | ||||
-rw-r--r-- | Acl/Domain/PermissionGrantingStrategy.php | 2 | ||||
-rw-r--r-- | Acl/Domain/UserSecurityIdentity.php | 2 | ||||
-rw-r--r-- | Acl/Model/AclCacheInterface.php | 4 | ||||
-rw-r--r-- | Acl/Model/AclInterface.php | 20 | ||||
-rw-r--r-- | Acl/Model/AuditableAclInterface.php | 28 | ||||
-rw-r--r-- | Acl/Model/MutableAclInterface.php | 42 | ||||
-rw-r--r-- | Acl/Model/MutableAclProviderInterface.php | 6 | ||||
-rw-r--r-- | Acl/Model/ObjectIdentityInterface.php | 1 | ||||
-rw-r--r-- | Acl/Model/ObjectIdentityRetrievalStrategyInterface.php | 1 | ||||
-rw-r--r-- | Acl/Model/PermissionGrantingStrategyInterface.php | 1 | ||||
-rw-r--r-- | Acl/Permission/MaskBuilder.php | 6 | ||||
-rw-r--r-- | Acl/Permission/PermissionMapInterface.php | 2 | ||||
-rw-r--r-- | Acl/Tests/Dbal/AclProviderBenchmarkTest.php | 2 | ||||
-rw-r--r-- | Acl/Tests/Dbal/MutableAclProviderTest.php | 1 | ||||
-rw-r--r-- | Acl/Tests/Voter/AclVoterTest.php | 14 |
21 files changed, 174 insertions, 116 deletions
diff --git a/Acl/Dbal/AclProvider.php b/Acl/Dbal/AclProvider.php index 5bcaf82..705b4ff 100644 --- a/Acl/Dbal/AclProvider.php +++ b/Acl/Dbal/AclProvider.php @@ -104,7 +104,7 @@ class AclProvider implements AclProviderInterface $currentBatch = array(); $oidLookup = array(); - for ($i = 0,$c = count($oids); $i<$c; $i++) { + for ($i = 0, $c = count($oids); $i<$c; $i++) { $oid = $oids[$i]; $oidLookupKey = $oid->getIdentifier().$oid->getType(); $oidLookup[$oidLookupKey] = $oid; @@ -224,6 +224,7 @@ class AclProvider implements AclProviderInterface * ACEs, and security identities. * * @param array $ancestorIds + * * @return string */ protected function getLookupSql(array $ancestorIds) @@ -330,6 +331,7 @@ SELECTCLAUSE; * * @param ObjectIdentityInterface $oid * @param bool $directChildrenOnly + * * @return string */ protected function getFindChildrenSql(ObjectIdentityInterface $oid, $directChildrenOnly) @@ -361,6 +363,7 @@ FINDCHILDREN; * identity. * * @param ObjectIdentityInterface $oid + * * @return string */ protected function getSelectObjectIdentityIdSql(ObjectIdentityInterface $oid) @@ -385,6 +388,7 @@ QUERY; * Returns the primary key of the passed object identity. * * @param ObjectIdentityInterface $oid + * * @return int */ final protected function retrieveObjectIdentityPrimaryKey(ObjectIdentityInterface $oid) @@ -493,8 +497,10 @@ QUERY; * @param Statement $stmt * @param array $oidLookup * @param array $sids - * @throws \RuntimeException + * * @return \SplObjectStorage + * + * @throws \RuntimeException */ private function hydrateObjectIdentities(Statement $stmt, array $oidLookup, array $sids) { diff --git a/Acl/Dbal/MutableAclProvider.php b/Acl/Dbal/MutableAclProvider.php index 261d932..b1c28c6 100644 --- a/Acl/Dbal/MutableAclProvider.php +++ b/Acl/Dbal/MutableAclProvider.php @@ -378,7 +378,8 @@ class MutableAclProvider extends AclProvider implements MutableAclProviderInterf /** * Constructs the SQL for deleting access control entries. * - * @param int $oidPK + * @param int $oidPK + * * @return string */ protected function getDeleteAccessControlEntriesSql($oidPK) @@ -393,7 +394,8 @@ class MutableAclProvider extends AclProvider implements MutableAclProviderInterf /** * Constructs the SQL for deleting a specific ACE. * - * @param int $acePK + * @param int $acePK + * * @return string */ protected function getDeleteAccessControlEntrySql($acePK) @@ -408,7 +410,8 @@ class MutableAclProvider extends AclProvider implements MutableAclProviderInterf /** * Constructs the SQL for deleting an object identity. * - * @param int $pk + * @param int $pk + * * @return string */ protected function getDeleteObjectIdentitySql($pk) @@ -423,7 +426,8 @@ class MutableAclProvider extends AclProvider implements MutableAclProviderInterf /** * Constructs the SQL for deleting relation entries. * - * @param int $pk + * @param int $pk + * * @return string */ protected function getDeleteObjectIdentityRelationsSql($pk) @@ -438,16 +442,17 @@ class MutableAclProvider extends AclProvider implements MutableAclProviderInterf /** * Constructs the SQL for inserting an ACE. * - * @param int $classId - * @param int|null $objectIdentityId - * @param string|null $field - * @param int $aceOrder - * @param int $securityIdentityId - * @param string $strategy - * @param int $mask - * @param bool $granting - * @param bool $auditSuccess - * @param bool $auditFailure + * @param int $classId + * @param int|null $objectIdentityId + * @param string|null $field + * @param int $aceOrder + * @param int $securityIdentityId + * @param string $strategy + * @param int $mask + * @param bool $granting + * @param bool $auditSuccess + * @param bool $auditFailure + * * @return string */ protected function getInsertAccessControlEntrySql($classId, $objectIdentityId, $field, $aceOrder, $securityIdentityId, $strategy, $mask, $granting, $auditSuccess, $auditFailure) @@ -488,6 +493,7 @@ QUERY; * Constructs the SQL for inserting a new class type. * * @param string $classType + * * @return string */ protected function getInsertClassSql($classType) @@ -502,8 +508,9 @@ QUERY; /** * Constructs the SQL for inserting a relation entry. * - * @param int $objectIdentityId - * @param int $ancestorId + * @param int $objectIdentityId + * @param int $ancestorId + * * @return string */ protected function getInsertObjectIdentityRelationSql($objectIdentityId, $ancestorId) @@ -519,9 +526,10 @@ QUERY; /** * Constructs the SQL for inserting an object identity. * - * @param string $identifier - * @param int $classId - * @param bool $entriesInheriting + * @param string $identifier + * @param int $classId + * @param bool $entriesInheriting + * * @return string */ protected function getInsertObjectIdentitySql($identifier, $classId, $entriesInheriting) @@ -544,7 +552,9 @@ QUERY; * Constructs the SQL for inserting a security identity. * * @param SecurityIdentityInterface $sid + * * @throws \InvalidArgumentException + * * @return string */ protected function getInsertSecurityIdentitySql(SecurityIdentityInterface $sid) @@ -570,10 +580,11 @@ QUERY; /** * Constructs the SQL for selecting an ACE. * - * @param int $classId - * @param int $oid - * @param string $field - * @param int $order + * @param int $classId + * @param int $oid + * @param string $field + * @param int $order + * * @return string */ protected function getSelectAccessControlEntryIdSql($classId, $oid, $field, $order) @@ -597,6 +608,7 @@ QUERY; * the passed class type. * * @param string $classType + * * @return string */ protected function getSelectClassIdSql($classType) @@ -612,7 +624,9 @@ QUERY; * Constructs the SQL for selecting the primary key of a security identity. * * @param SecurityIdentityInterface $sid + * * @throws \InvalidArgumentException + * * @return string */ protected function getSelectSecurityIdentityIdSql(SecurityIdentityInterface $sid) @@ -653,9 +667,11 @@ QUERY; /** * Constructs the SQL for updating an object identity. * - * @param int $pk - * @param array $changes + * @param int $pk + * @param array $changes + * * @throws \InvalidArgumentException + * * @return string */ protected function getUpdateObjectIdentitySql($pk, array $changes) @@ -700,9 +716,11 @@ QUERY; /** * Constructs the SQL for updating an ACE. * - * @param int $pk - * @param array $sets + * @param int $pk + * @param array $sets + * * @throws \InvalidArgumentException + * * @return string */ protected function getUpdateAccessControlEntrySql($pk, array $sets) @@ -737,6 +755,7 @@ QUERY; * If the type does not yet exist in the database, it will be created. * * @param string $classType + * * @return int */ private function createOrRetrieveClassId($classType) @@ -757,6 +776,7 @@ QUERY; * created. * * @param SecurityIdentityInterface $sid + * * @return int */ private function createOrRetrieveSecurityIdentityId(SecurityIdentityInterface $sid) @@ -773,7 +793,7 @@ QUERY; /** * Deletes all ACEs for the given object identity primary key. * - * @param int $oidPK + * @param int $oidPK */ private function deleteAccessControlEntries($oidPK) { @@ -783,7 +803,7 @@ QUERY; /** * Deletes the object identity from the database. * - * @param int $pk + * @param int $pk */ private function deleteObjectIdentity($pk) { @@ -793,7 +813,7 @@ QUERY; /** * Deletes all entries from the relations table from the database. * - * @param int $pk + * @param int $pk */ private function deleteObjectIdentityRelations($pk) { @@ -831,7 +851,7 @@ QUERY; $classIds = new \SplObjectStorage(); $currentIds = array(); foreach ($changes[1] as $field => $new) { - for ($i = 0,$c = count($new); $i<$c; $i++) { + for ($i = 0, $c = count($new); $i<$c; $i++) { $ace = $new[$i]; if (null === $ace->getId()) { @@ -908,7 +928,7 @@ QUERY; $sids = new \SplObjectStorage(); $classIds = new \SplObjectStorage(); $currentIds = array(); - for ($i = 0,$c = count($new); $i<$c; $i++) { + for ($i = 0, $c = count($new); $i<$c; $i++) { $ace = $new[$i]; if (null === $ace->getId()) { @@ -951,7 +971,7 @@ QUERY; list($old, $new) = $changes; $currentIds = array(); - for ($i = 0,$c = count($new); $i<$c; $i++) { + for ($i = 0, $c = count($new); $i<$c; $i++) { $ace = $new[$i]; if (null !== $ace->getId()) { diff --git a/Acl/Domain/Acl.php b/Acl/Domain/Acl.php index d3aecfb..c237448 100644 --- a/Acl/Domain/Acl.php +++ b/Acl/Domain/Acl.php @@ -391,8 +391,9 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged /** * Deletes an ACE * - * @param string $property - * @param int $index + * @param string $property + * @param int $index + * * @throws \OutOfBoundsException */ private function deleteAce($property, $index) @@ -407,7 +408,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged $this->$property = array_values($this->$property); $this->onPropertyChanged($property, $oldValue, $this->$property); - for ($i = $index,$c = count($this->$property); $i<$c; $i++) { + for ($i = $index, $c = count($this->$property); $i<$c; $i++) { $this->onEntryPropertyChanged($aces[$i], 'aceOrder', $i+1, $i); } } @@ -415,9 +416,10 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged /** * Deletes a field-based ACE * - * @param string $property - * @param int $index - * @param string $field + * @param string $property + * @param int $index + * @param string $field + * * @throws \OutOfBoundsException */ private function deleteFieldAce($property, $index, $field) @@ -432,7 +434,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged $aces[$field] = array_values($aces[$field]); $this->onPropertyChanged($property, $oldValue, $this->$property); - for ($i = $index,$c = count($aces[$field]); $i<$c; $i++) { + for ($i = $index, $c = count($aces[$field]); $i<$c; $i++) { $this->onEntryPropertyChanged($aces[$field][$i], 'aceOrder', $i+1, $i); } } @@ -446,6 +448,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param SecurityIdentityInterface $sid * @param bool $granting * @param string $strategy + * * @throws \OutOfBoundsException * @throws \InvalidArgumentException */ @@ -476,7 +479,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged array_slice($this->$property, $index) ); - for ($i = $index,$c = count($this->$property)-1; $i<$c; $i++) { + for ($i = $index, $c = count($this->$property)-1; $i<$c; $i++) { $this->onEntryPropertyChanged($aces[$i+1], 'aceOrder', $i, $i+1); } } @@ -495,6 +498,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged * @param SecurityIdentityInterface $sid * @param bool $granting * @param string $strategy + * * @throws \InvalidArgumentException * @throws \OutOfBoundsException */ @@ -533,7 +537,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged array_slice($aces[$field], $index) ); - for ($i = $index,$c = count($aces[$field])-1; $i<$c; $i++) { + for ($i = $index, $c = count($aces[$field])-1; $i<$c; $i++) { $this->onEntryPropertyChanged($aces[$field][$i+1], 'aceOrder', $i, $i+1); } } @@ -545,10 +549,11 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged /** * Updates an ACE * - * @param string $property - * @param int $index - * @param int $mask - * @param string $strategy + * @param string $property + * @param int $index + * @param int $mask + * @param string $strategy + * * @throws \OutOfBoundsException */ private function updateAce($property, $index, $mask, $strategy = null) @@ -572,10 +577,11 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged /** * Updates auditing for an ACE * - * @param array &$aces - * @param int $index - * @param bool $auditSuccess - * @param bool $auditFailure + * @param array &$aces + * @param int $index + * @param bool $auditSuccess + * @param bool $auditFailure + * * @throws \OutOfBoundsException */ private function updateAuditing(array &$aces, $index, $auditSuccess, $auditFailure) @@ -598,11 +604,12 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged /** * Updates a field-based ACE * - * @param string $property - * @param int $index - * @param string $field - * @param int $mask - * @param string $strategy + * @param string $property + * @param int $index + * @param string $field + * @param int $mask + * @param string $strategy + * * @throws \InvalidArgumentException * @throws \OutOfBoundsException */ diff --git a/Acl/Domain/DoctrineAclCache.php b/Acl/Domain/DoctrineAclCache.php index 0c69773..00864f0 100644 --- a/Acl/Domain/DoctrineAclCache.php +++ b/Acl/Domain/DoctrineAclCache.php @@ -147,6 +147,7 @@ class DoctrineAclCache implements AclCacheInterface * Unserializes the ACL. * * @param string $serialized + * * @return AclInterface */ private function unserializeAcl($serialized) @@ -205,6 +206,7 @@ class DoctrineAclCache implements AclCacheInterface * Returns the key for the object identity * * @param ObjectIdentityInterface $oid + * * @return string */ private function getDataKeyByIdentity(ObjectIdentityInterface $oid) @@ -217,6 +219,7 @@ class DoctrineAclCache implements AclCacheInterface * Returns the alias key for the object identity key * * @param string $aclId + * * @return string */ private function getAliasKeyForIdentity($aclId) diff --git a/Acl/Domain/Entry.php b/Acl/Domain/Entry.php index b5eb28b..a487c96 100644 --- a/Acl/Domain/Entry.php +++ b/Acl/Domain/Entry.php @@ -125,7 +125,7 @@ class Entry implements AuditableEntryInterface * Do never call this method directly. Use the respective methods on the * AclInterface instead. * - * @param bool $boolean + * @param bool $boolean */ public function setAuditFailure($boolean) { @@ -138,7 +138,7 @@ class Entry implements AuditableEntryInterface * Do never call this method directly. Use the respective methods on the * AclInterface instead. * - * @param bool $boolean + * @param bool $boolean */ public function setAuditSuccess($boolean) { @@ -151,7 +151,7 @@ class Entry implements AuditableEntryInterface * Do never call this method directly. Use the respective methods on the * AclInterface instead. * - * @param int $mask + * @param int $mask */ public function setMask($mask) { diff --git a/Acl/Domain/ObjectIdentity.php b/Acl/Domain/ObjectIdentity.php index cf10330..1111089 100644 --- a/Acl/Domain/ObjectIdentity.php +++ b/Acl/Domain/ObjectIdentity.php @@ -51,7 +51,9 @@ final class ObjectIdentity implements ObjectIdentityInterface * Constructs an ObjectIdentity for the given domain object * * @param object $domainObject + * * @throws InvalidDomainObjectException + * * @return ObjectIdentity */ public static function fromDomainObject($domainObject) diff --git a/Acl/Domain/PermissionGrantingStrategy.php b/Acl/Domain/PermissionGrantingStrategy.php index 81ed9d8..5d91f61 100644 --- a/Acl/Domain/PermissionGrantingStrategy.php +++ b/Acl/Domain/PermissionGrantingStrategy.php @@ -130,7 +130,7 @@ class PermissionGrantingStrategy implements PermissionGrantingStrategyInterface * @param SecurityIdentityInterface[] $sids An array of SecurityIdentityInterface implementations * @param bool $administrativeMode True turns off audit logging * - * @return bool true, or false; either granting, or denying access respectively. + * @return bool true, or false; either granting, or denying access respectively. * * @throws NoAceFoundException */ diff --git a/Acl/Domain/UserSecurityIdentity.php b/Acl/Domain/UserSecurityIdentity.php index 9418c81..a5b3d77 100644 --- a/Acl/Domain/UserSecurityIdentity.php +++ b/Acl/Domain/UserSecurityIdentity.php @@ -51,6 +51,7 @@ final class UserSecurityIdentity implements SecurityIdentityInterface * Creates a user security identity from a UserInterface * * @param UserInterface $user + * * @return UserSecurityIdentity */ public static function fromAccount(UserInterface $user) @@ -62,6 +63,7 @@ final class UserSecurityIdentity implements SecurityIdentityInterface * Creates a user security identity from a TokenInterface * * @param TokenInterface $token + * * @return UserSecurityIdentity */ public static function fromToken(TokenInterface $token) diff --git a/Acl/Model/AclCacheInterface.php b/Acl/Model/AclCacheInterface.php index 4673e01..03431db 100644 --- a/Acl/Model/AclCacheInterface.php +++ b/Acl/Model/AclCacheInterface.php @@ -37,7 +37,8 @@ interface AclCacheInterface /** * Retrieves an ACL for the given object identity primary key from the cache * - * @param int $primaryKey + * @param int $primaryKey + * * @return AclInterface */ public function getFromCacheById($primaryKey); @@ -46,6 +47,7 @@ interface AclCacheInterface * Retrieves an ACL for the given object identity from the cache * * @param ObjectIdentityInterface $oid + * * @return AclInterface */ public function getFromCacheByIdentity(ObjectIdentityInterface $oid); diff --git a/Acl/Model/AclInterface.php b/Acl/Model/AclInterface.php index 85a4e83..c5bbf18 100644 --- a/Acl/Model/AclInterface.php +++ b/Acl/Model/AclInterface.php @@ -36,6 +36,7 @@ interface AclInterface extends \Serializable * Returns all class-field-based ACEs associated with this ACL * * @param string $field + * * @return array */ public function getClassFieldAces($field); @@ -51,6 +52,7 @@ interface AclInterface extends \Serializable * Returns all object-field-based ACEs associated with this ACL * * @param string $field + * * @return array */ public function getObjectFieldAces($field); @@ -79,10 +81,11 @@ interface AclInterface extends \Serializable /** * Determines whether field access is granted * - * @param string $field - * @param array $masks - * @param array $securityIdentities - * @param bool $administrativeMode + * @param string $field + * @param array $masks + * @param array $securityIdentities + * @param bool $administrativeMode + * * @return bool */ public function isFieldGranted($field, array $masks, array $securityIdentities, $administrativeMode = false); @@ -90,10 +93,12 @@ interface AclInterface extends \Serializable /** * Determines whether access is granted * + * @param array $masks + * @param array $securityIdentities + * @param bool $administrativeMode + * * @throws NoAceFoundException when no ACE was applicable for this request - * @param array $masks - * @param array $securityIdentities - * @param bool $administrativeMode + * * @return bool */ public function isGranted(array $masks, array $securityIdentities, $administrativeMode = false); @@ -102,6 +107,7 @@ interface AclInterface extends \Serializable * Whether the ACL has loaded ACEs for all of the passed security identities * * @param mixed $securityIdentities an implementation of SecurityIdentityInterface, or an array thereof + * * @return bool */ public function isSidLoaded($securityIdentities); diff --git a/Acl/Model/AuditableAclInterface.php b/Acl/Model/AuditableAclInterface.php index f5ed9dd..80b9987 100644 --- a/Acl/Model/AuditableAclInterface.php +++ b/Acl/Model/AuditableAclInterface.php @@ -21,38 +21,38 @@ interface AuditableAclInterface extends MutableAclInterface /** * Updates auditing for class-based ACE * - * @param int $index - * @param bool $auditSuccess - * @param bool $auditFailure + * @param int $index + * @param bool $auditSuccess + * @param bool $auditFailure */ public function updateClassAuditing($index, $auditSuccess, $auditFailure); /** * Updates auditing for class-field-based ACE * - * @param int $index - * @param string $field - * @param bool $auditSuccess - * @param bool $auditFailure + * @param int $index + * @param string $field + * @param bool $auditSuccess + * @param bool $auditFailure */ public function updateClassFieldAuditing($index, $field, $auditSuccess, $auditFailure); /** * Updates auditing for object-based ACE * - * @param int $index - * @param bool $auditSuccess - * @param bool $auditFailure + * @param int $index + * @param bool $auditSuccess + * @param bool $auditFailure */ public function updateObjectAuditing($index, $auditSuccess, $auditFailure); /** * Updates auditing for object-field-based ACE * - * @param int $index - * @param string $field - * @param bool $auditSuccess - * @param bool $auditFailure + * @param int $index + * @param string $field + * @param bool $auditSuccess + * @param bool $auditFailure */ public function updateObjectFieldAuditing($index, $field, $auditSuccess, $auditFailure); } diff --git a/Acl/Model/MutableAclInterface.php b/Acl/Model/MutableAclInterface.php index 8993aa5..f94e909 100644 --- a/Acl/Model/MutableAclInterface.php +++ b/Acl/Model/MutableAclInterface.php @@ -24,30 +24,30 @@ interface MutableAclInterface extends AclInterface /** * Deletes a class-based ACE * - * @param int $index + * @param int $index */ public function deleteClassAce($index); /** * Deletes a class-field-based ACE * - * @param int $index - * @param string $field + * @param int $index + * @param string $field */ public function deleteClassFieldAce($index, $field); /** * Deletes an object-based ACE * - * @param int $index + * @param int $index */ public function deleteObjectAce($index); /** * Deletes an object-field-based ACE * - * @param int $index - * @param string $field + * @param int $index + * @param string $field */ public function deleteObjectFieldAce($index, $field); @@ -107,7 +107,7 @@ interface MutableAclInterface extends AclInterface /** * Sets whether entries are inherited * - * @param bool $boolean + * @param bool $boolean */ public function setEntriesInheriting($boolean); @@ -121,38 +121,38 @@ interface MutableAclInterface extends AclInterface /** * Updates a class-based ACE * - * @param int $index - * @param int $mask - * @param string $strategy if null the strategy should not be changed + * @param int $index + * @param int $mask + * @param string $strategy if null the strategy should not be changed */ public function updateClassAce($index, $mask, $strategy = null); /** * Updates a class-field-based ACE * - * @param int $index - * @param string $field - * @param int $mask - * @param string $strategy if null the strategy should not be changed + * @param int $index + * @param string $field + * @param int $mask + * @param string $strategy if null the strategy should not be changed */ public function updateClassFieldAce($index, $field, $mask, $strategy = null); /** * Updates an object-based ACE * - * @param int $index - * @param int $mask - * @param string $strategy if null the strategy should not be changed + * @param int $index + * @param int $mask + * @param string $strategy if null the strategy should not be changed */ public function updateObjectAce($index, $mask, $strategy = null); /** * Updates an object-field-based ACE * - * @param int $index - * @param string $field - * @param int $mask - * @param string $strategy if null the strategy should not be changed + * @param int $index + * @param string $field + * @param int $mask + * @param string $strategy if null the strategy should not be changed */ public function updateObjectFieldAce($index, $field, $mask, $strategy = null); } diff --git a/Acl/Model/MutableAclProviderInterface.php b/Acl/Model/MutableAclProviderInterface.php index cb34b72..f5bb198 100644 --- a/Acl/Model/MutableAclProviderInterface.php +++ b/Acl/Model/MutableAclProviderInterface.php @@ -21,9 +21,11 @@ interface MutableAclProviderInterface extends AclProviderInterface /** * Creates a new ACL for the given object identity. * - * @throws AclAlreadyExistsException when there already is an ACL for the given - * object identity * @param ObjectIdentityInterface $oid + * + * @throws AclAlreadyExistsException when there already is an ACL for the given + * object identity + * * @return MutableAclInterface */ public function createAcl(ObjectIdentityInterface $oid); diff --git a/Acl/Model/ObjectIdentityInterface.php b/Acl/Model/ObjectIdentityInterface.php index 2ee365f..6574b49 100644 --- a/Acl/Model/ObjectIdentityInterface.php +++ b/Acl/Model/ObjectIdentityInterface.php @@ -28,6 +28,7 @@ interface ObjectIdentityInterface * Example for Object Equality: $object1->getId() === $object2->getId() * * @param ObjectIdentityInterface $identity + * * @return bool */ public function equals(ObjectIdentityInterface $identity); diff --git a/Acl/Model/ObjectIdentityRetrievalStrategyInterface.php b/Acl/Model/ObjectIdentityRetrievalStrategyInterface.php index b0f7f78..d5470ae 100644 --- a/Acl/Model/ObjectIdentityRetrievalStrategyInterface.php +++ b/Acl/Model/ObjectIdentityRetrievalStrategyInterface.php @@ -22,6 +22,7 @@ interface ObjectIdentityRetrievalStrategyInterface * Retrieves the object identity from a domain object * * @param object $domainObject + * * @return ObjectIdentityInterface */ public function getObjectIdentity($domainObject); diff --git a/Acl/Model/PermissionGrantingStrategyInterface.php b/Acl/Model/PermissionGrantingStrategyInterface.php index 25f1687..7ff475f 100644 --- a/Acl/Model/PermissionGrantingStrategyInterface.php +++ b/Acl/Model/PermissionGrantingStrategyInterface.php @@ -25,6 +25,7 @@ interface PermissionGrantingStrategyInterface * @param array $masks * @param array $sids * @param bool $administrativeMode + * * @return bool */ public function isGranted(AclInterface $acl, array $masks, array $sids, $administrativeMode = false); diff --git a/Acl/Permission/MaskBuilder.php b/Acl/Permission/MaskBuilder.php index 32084ed..d238a18 100644 --- a/Acl/Permission/MaskBuilder.php +++ b/Acl/Permission/MaskBuilder.php @@ -72,7 +72,7 @@ class MaskBuilder /** * Constructor * - * @param int $mask optional; defaults to 0 + * @param int $mask optional; defaults to 0 * * @throws \InvalidArgumentException */ @@ -166,9 +166,11 @@ class MaskBuilder /** * Returns the code for the passed mask * - * @param int $mask + * @param int $mask + * * @throws \InvalidArgumentException * @throws \RuntimeException + * * @return string */ public static function getCode($mask) diff --git a/Acl/Permission/PermissionMapInterface.php b/Acl/Permission/PermissionMapInterface.php index 20ca181..1b2a7fd 100644 --- a/Acl/Permission/PermissionMapInterface.php +++ b/Acl/Permission/PermissionMapInterface.php @@ -26,6 +26,7 @@ interface PermissionMapInterface * * @param string $permission * @param object $object + * * @return array may return null if permission/object combination is not supported */ public function getMasks($permission, $object); @@ -34,6 +35,7 @@ interface PermissionMapInterface * Whether this map contains the given permission * * @param string $permission + * * @return bool */ public function contains($permission); diff --git a/Acl/Tests/Dbal/AclProviderBenchmarkTest.php b/Acl/Tests/Dbal/AclProviderBenchmarkTest.php index c7383dc..dab90d4 100644 --- a/Acl/Tests/Dbal/AclProviderBenchmarkTest.php +++ b/Acl/Tests/Dbal/AclProviderBenchmarkTest.php @@ -107,7 +107,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase protected function generateAclLevel($depth, $parentId, $ancestors) { $level = count($ancestors); - for ($i = 0,$t = rand(1, 10); $i<$t; $i++) { + for ($i = 0, $t = rand(1, 10); $i<$t; $i++) { $id = $this->generateAcl($this->chooseClassId(), $parentId, $ancestors); if ($level < $depth) { diff --git a/Acl/Tests/Dbal/MutableAclProviderTest.php b/Acl/Tests/Dbal/MutableAclProviderTest.php index f0a68a0..457fbfa 100644 --- a/Acl/Tests/Dbal/MutableAclProviderTest.php +++ b/Acl/Tests/Dbal/MutableAclProviderTest.php @@ -452,6 +452,7 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase * * @param AclProvider $provider * @param array $data + * * @throws \InvalidArgumentException * @throws \Exception */ diff --git a/Acl/Tests/Voter/AclVoterTest.php b/Acl/Tests/Voter/AclVoterTest.php index f13df1f..c4c0b4e 100644 --- a/Acl/Tests/Voter/AclVoterTest.php +++ b/Acl/Tests/Voter/AclVoterTest.php @@ -27,7 +27,7 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase */ public function testSupportsAttribute($attribute, $supported) { - list($voter,, $permissionMap,,) = $this->getVoter(true, false); + list($voter, , $permissionMap, ,) = $this->getVoter(true, false); $permissionMap ->expects($this->once()) @@ -44,7 +44,7 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase */ public function testSupportsAttributeNonString($attribute) { - list($voter,,,,,) = $this->getVoter(true, false); + list($voter, , , , ,) = $this->getVoter(true, false); $this->assertFalse($voter->supportsAttribute($attribute)); } @@ -72,7 +72,7 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase */ public function testSupportsClass($class) { - list($voter,,,,) = $this->getVoter(); + list($voter, , , ,) = $this->getVoter(); $this->assertTrue($voter->supportsClass($class)); } @@ -88,7 +88,7 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase public function testVote() { - list($voter,, $permissionMap,,) = $this->getVoter(); + list($voter, , $permissionMap, ,) = $this->getVoter(); $permissionMap ->expects($this->atLeastOnce()) ->method('getMasks') @@ -103,7 +103,7 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase */ public function testVoteWhenNoObjectIsPassed($allowIfObjectIdentityUnavailable) { - list($voter,, $permissionMap,,) = $this->getVoter($allowIfObjectIdentityUnavailable); + list($voter, , $permissionMap, ,) = $this->getVoter($allowIfObjectIdentityUnavailable); $permissionMap ->expects($this->once()) ->method('getMasks') @@ -124,7 +124,7 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase */ public function testVoteWhenOidStrategyReturnsNull($allowIfUnavailable) { - list($voter,, $permissionMap, $oidStrategy,) = $this->getVoter($allowIfUnavailable); + list($voter, , $permissionMap, $oidStrategy,) = $this->getVoter($allowIfUnavailable); $permissionMap ->expects($this->once()) ->method('getMasks') @@ -365,7 +365,7 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase { list($voter, $provider, $permissionMap, $oidStrategy, $sidStrategy) = $this->getVoter(); - $oid = new ObjectIdentity('someID','someType'); + $oid = new ObjectIdentity('someID', 'someType'); $permissionMap ->expects($this->once()) |