diff options
-rw-r--r-- | Acl/Dbal/AclProvider.php | 4 | ||||
-rw-r--r-- | Acl/Dbal/MutableAclProvider.php | 6 | ||||
-rw-r--r-- | Acl/Domain/Acl.php | 16 | ||||
-rw-r--r-- | Acl/Permission/MaskBuilder.php | 2 | ||||
-rw-r--r-- | Core/Authentication/Token/AbstractToken.php | 2 | ||||
-rw-r--r-- | Tests/Acl/Dbal/AclProviderBenchmarkTest.php | 18 | ||||
-rw-r--r-- | Tests/Core/Util/SecureRandomTest.php | 2 | ||||
-rw-r--r-- | Tests/Http/RememberMe/TokenBasedRememberMeServicesTest.php | 4 |
8 files changed, 27 insertions, 27 deletions
diff --git a/Acl/Dbal/AclProvider.php b/Acl/Dbal/AclProvider.php index 5074614..2cc2111 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; @@ -313,7 +313,7 @@ SELECTCLAUSE; $this->connection->quote($batch[$i]->getType()) ); - if ($i+1 < $count) { + if ($i + 1 < $count) { $sql .= ' OR '; } } diff --git a/Acl/Dbal/MutableAclProvider.php b/Acl/Dbal/MutableAclProvider.php index c34d752..74f52ce 100644 --- a/Acl/Dbal/MutableAclProvider.php +++ b/Acl/Dbal/MutableAclProvider.php @@ -786,7 +786,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()) { @@ -860,7 +860,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()) { @@ -901,7 +901,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 43ce32a..364f6b8 100644 --- a/Acl/Domain/Acl.php +++ b/Acl/Domain/Acl.php @@ -415,8 +415,8 @@ 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++) { - $this->onEntryPropertyChanged($aces[$i], 'aceOrder', $i+1, $i); + for ($i = $index, $c = count($this->$property); $i < $c; $i++) { + $this->onEntryPropertyChanged($aces[$i], 'aceOrder', $i + 1, $i); } } @@ -441,8 +441,8 @@ 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++) { - $this->onEntryPropertyChanged($aces[$field][$i], 'aceOrder', $i+1, $i); + for ($i = $index, $c = count($aces[$field]); $i < $c; $i++) { + $this->onEntryPropertyChanged($aces[$field][$i], 'aceOrder', $i + 1, $i); } } @@ -486,8 +486,8 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged array_slice($this->$property, $index) ); - for ($i = $index, $c = count($this->$property)-1; $i<$c; $i++) { - $this->onEntryPropertyChanged($aces[$i+1], 'aceOrder', $i, $i+1); + for ($i = $index, $c = count($this->$property) - 1; $i < $c; $i++) { + $this->onEntryPropertyChanged($aces[$i + 1], 'aceOrder', $i, $i + 1); } } @@ -544,8 +544,8 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged array_slice($aces[$field], $index) ); - for ($i = $index, $c = count($aces[$field])-1; $i<$c; $i++) { - $this->onEntryPropertyChanged($aces[$field][$i+1], 'aceOrder', $i, $i+1); + 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 39fe4e7..c45e2f9 100644 --- a/Acl/Permission/MaskBuilder.php +++ b/Acl/Permission/MaskBuilder.php @@ -128,7 +128,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/Core/Authentication/Token/AbstractToken.php b/Core/Authentication/Token/AbstractToken.php index c239f8c..d2dc668 100644 --- a/Core/Authentication/Token/AbstractToken.php +++ b/Core/Authentication/Token/AbstractToken.php @@ -235,7 +235,7 @@ abstract class AbstractToken implements TokenInterface public function __toString() { $class = get_class($this); - $class = substr($class, strrpos($class, '\\')+1); + $class = substr($class, strrpos($class, '\\') + 1); $roles = array(); foreach ($this->roles as $role) { diff --git a/Tests/Acl/Dbal/AclProviderBenchmarkTest.php b/Tests/Acl/Dbal/AclProviderBenchmarkTest.php index f1c9554..2657001 100644 --- a/Tests/Acl/Dbal/AclProviderBenchmarkTest.php +++ b/Tests/Acl/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) { @@ -124,9 +124,9 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase $this->insertClassStmt->execute(array($id, $this->getRandomString(rand(20, 100), 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\\_'))); ++$id; - return $id-1; + return $id - 1; } else { - return rand(1000, $id-1); + return rand(1000, $id - 1); } } @@ -150,7 +150,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase $this->generateAces($classId, $id); ++$id; - return $id-1; + return $id - 1; } protected function chooseSid() @@ -165,9 +165,9 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase )); ++$id; - return $id-1; + return $id - 1; } else { - return rand(1000, $id-1); + return rand(1000, $id - 1); } } @@ -185,7 +185,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase $sid = $this->chooseSid(); } while (array_key_exists($sid, $sids) && in_array($fieldName, $sids[$sid], true)); - $fieldOrder[$fieldName] = array_key_exists($fieldName, $fieldOrder) ? $fieldOrder[$fieldName]+1 : 0; + $fieldOrder[$fieldName] = array_key_exists($fieldName, $fieldOrder) ? $fieldOrder[$fieldName] + 1 : 0; if (!isset($sids[$sid])) { $sids[$sid] = array(); } @@ -238,7 +238,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase $cLength = strlen($chars); while (strlen($s) < $length) { - $s .= $chars[mt_rand(0, $cLength-1)]; + $s .= $chars[mt_rand(0, $cLength - 1)]; } return $s; diff --git a/Tests/Core/Util/SecureRandomTest.php b/Tests/Core/Util/SecureRandomTest.php index a8cc660..316b049 100644 --- a/Tests/Core/Util/SecureRandomTest.php +++ b/Tests/Core/Util/SecureRandomTest.php @@ -49,7 +49,7 @@ class SecureRandomTest extends \PHPUnit_Framework_TestCase $f += $c[$i] * $c[$i]; } - $Y = 16/5000 * $f - 5000; + $Y = 16 / 5000 * $f - 5000; $this->assertTrue($Y > 1.03 && $Y < 57.4, 'Poker test failed, Y = '.$Y); } diff --git a/Tests/Http/RememberMe/TokenBasedRememberMeServicesTest.php b/Tests/Http/RememberMe/TokenBasedRememberMeServicesTest.php index 7947753..4606003 100644 --- a/Tests/Http/RememberMe/TokenBasedRememberMeServicesTest.php +++ b/Tests/Http/RememberMe/TokenBasedRememberMeServicesTest.php @@ -43,7 +43,7 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase $userProvider = $this->getProvider(); $service = $this->getService($userProvider, array('name' => 'foo', 'path' => null, 'domain' => null, 'always_remember_me' => true, 'lifetime' => 3600)); $request = new Request(); - $request->cookies->set('foo', $this->getCookie('fooclass', 'foouser', time()+3600, 'foopass')); + $request->cookies->set('foo', $this->getCookie('fooclass', 'foouser', time() + 3600, 'foopass')); $userProvider ->expects($this->once()) @@ -129,7 +129,7 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase $service = $this->getService($userProvider, array('name' => 'foo', 'always_remember_me' => true, 'lifetime' => 3600)); $request = new Request(); - $request->cookies->set('foo', $this->getCookie('fooclass', 'foouser', time()+3600, 'foopass')); + $request->cookies->set('foo', $this->getCookie('fooclass', 'foouser', time() + 3600, 'foopass')); $returnedToken = $service->autoLogin($request); |