diff options
Diffstat (limited to 'Acl')
-rw-r--r-- | Acl/Dbal/AclProvider.php | 8 | ||||
-rw-r--r-- | Acl/Dbal/MutableAclProvider.php | 12 | ||||
-rw-r--r-- | Acl/Domain/Acl.php | 8 | ||||
-rw-r--r-- | Acl/Permission/MaskBuilder.php | 2 | ||||
-rw-r--r-- | Acl/Tests/Dbal/AclProviderBenchmarkTest.php | 8 | ||||
-rw-r--r-- | Acl/Tests/Dbal/AclProviderTest.php | 2 | ||||
-rw-r--r-- | Acl/Tests/Domain/DoctrineAclCacheTest.php | 2 |
7 files changed, 21 insertions, 21 deletions
diff --git a/Acl/Dbal/AclProvider.php b/Acl/Dbal/AclProvider.php index 4714fb3..19b902f 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; @@ -281,7 +281,7 @@ SELECTCLAUSE; $types = array(); $count = count($batch); - for ($i = 0; $i < $count; $i++) { + for ($i = 0; $i < $count; ++$i) { if (!isset($types[$batch[$i]->getType()])) { $types[$batch[$i]->getType()] = true; @@ -296,7 +296,7 @@ SELECTCLAUSE; if (1 === count($types)) { $ids = array(); - for ($i = 0; $i < $count; $i++) { + for ($i = 0; $i < $count; ++$i) { $identifier = (string) $batch[$i]->getIdentifier(); $ids[] = $this->connection->quote($identifier); } @@ -308,7 +308,7 @@ SELECTCLAUSE; ); } else { $where = '(o.object_identifier = %s AND c.class_type = %s)'; - for ($i = 0; $i < $count; $i++) { + for ($i = 0; $i < $count; ++$i) { $sql .= sprintf( $where, $this->connection->quote($batch[$i]->getIdentifier()), diff --git a/Acl/Dbal/MutableAclProvider.php b/Acl/Dbal/MutableAclProvider.php index b28e2b2..7d802d4 100644 --- a/Acl/Dbal/MutableAclProvider.php +++ b/Acl/Dbal/MutableAclProvider.php @@ -854,7 +854,7 @@ QUERY; $sids = new \SplObjectStorage(); $classIds = new \SplObjectStorage(); 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()) { @@ -895,7 +895,7 @@ QUERY; { $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()) { @@ -905,7 +905,7 @@ QUERY; } foreach ($changes[0] as $old) { - for ($i = 0, $c = count($old); $i < $c; $i++) { + for ($i = 0, $c = count($old); $i < $c; ++$i) { $ace = $old[$i]; if (!isset($currentIds[$ace->getId()])) { @@ -928,7 +928,7 @@ QUERY; $sids = new \SplObjectStorage(); $classIds = new \SplObjectStorage(); - 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()) { @@ -969,7 +969,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()) { @@ -977,7 +977,7 @@ QUERY; } } - for ($i = 0, $c = count($old); $i < $c; $i++) { + for ($i = 0, $c = count($old); $i < $c; ++$i) { $ace = $old[$i]; if (!isset($currentIds[$ace->getId()])) { diff --git a/Acl/Domain/Acl.php b/Acl/Domain/Acl.php index 61153af..f417c8f 100644 --- a/Acl/Domain/Acl.php +++ b/Acl/Domain/Acl.php @@ -409,7 +409,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); } } @@ -435,7 +435,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); } } @@ -480,7 +480,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); } } @@ -538,7 +538,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); } } diff --git a/Acl/Permission/MaskBuilder.php b/Acl/Permission/MaskBuilder.php index 589adaa..7c1e503 100644 --- a/Acl/Permission/MaskBuilder.php +++ b/Acl/Permission/MaskBuilder.php @@ -122,7 +122,7 @@ class MaskBuilder $length = strlen($pattern); $bitmask = str_pad(decbin($this->mask), $length, '0', STR_PAD_LEFT); - for ($i = $length - 1; $i >= 0; $i--) { + for ($i = $length - 1; $i >= 0; --$i) { if ('1' === $bitmask[$i]) { try { $pattern[$i] = self::getCode(1 << ($length - $i - 1)); diff --git a/Acl/Tests/Dbal/AclProviderBenchmarkTest.php b/Acl/Tests/Dbal/AclProviderBenchmarkTest.php index 1f96752..c95b474 100644 --- a/Acl/Tests/Dbal/AclProviderBenchmarkTest.php +++ b/Acl/Tests/Dbal/AclProviderBenchmarkTest.php @@ -92,7 +92,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase $this->insertEntryStmt = $this->con->prepare('INSERT INTO acl_entries (id, class_id, object_identity_id, field_name, ace_order, security_identity_id, mask, granting, granting_strategy, audit_success, audit_failure) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); $this->insertOidAncestorStmt = $this->con->prepare('INSERT INTO acl_object_identity_ancestors (object_identity_id, ancestor_id) VALUES (?, ?)'); - for ($i = 0; $i < 40000; $i++) { + for ($i = 0; $i < 40000; ++$i) { $this->generateAclHierarchy(); } } @@ -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) { @@ -178,7 +178,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase $sids = array(); $fieldOrder = array(); - for ($i = 0; $i <= 30; $i++) { + for ($i = 0; $i <= 30; ++$i) { $fieldName = rand(0, 1) ? null : $this->getRandomString(rand(10, 20)); do { @@ -226,7 +226,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase while ($i <= 30) { $mask |= 1 << rand(0, 30); - $i++; + ++$i; } return $mask; diff --git a/Acl/Tests/Dbal/AclProviderTest.php b/Acl/Tests/Dbal/AclProviderTest.php index 717a258..9470d80 100644 --- a/Acl/Tests/Dbal/AclProviderTest.php +++ b/Acl/Tests/Dbal/AclProviderTest.php @@ -130,7 +130,7 @@ class AclProviderTest extends \PHPUnit_Framework_TestCase $i = 0; foreach ($aces as $index => $ace) { $this->assertEquals($i, $index); - $i++; + ++$i; } $sid = $aces[0]->getSecurityIdentity(); diff --git a/Acl/Tests/Domain/DoctrineAclCacheTest.php b/Acl/Tests/Domain/DoctrineAclCacheTest.php index 128f2c8..255f7f4 100644 --- a/Acl/Tests/Domain/DoctrineAclCacheTest.php +++ b/Acl/Tests/Domain/DoctrineAclCacheTest.php @@ -72,7 +72,7 @@ class DoctrineAclCacheTest extends \PHPUnit_Framework_TestCase $acl->insertClassFieldAce('foo', $sid, 1); $acl->insertObjectAce($sid, 1); $acl->insertObjectFieldAce('foo', $sid, 1); - $id++; + ++$id; if ($depth > 0) { $acl->setParentAcl($this->getAcl($depth - 1)); |