Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 18435f2

Browse files
committed
minor #14089 CS: Binary operators should be arounded by at least one space (keradus)
This PR was merged into the 2.3 branch. Discussion ---------- CS: Binary operators should be arounded by at least one space | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | ? | Fixed tickets | N/A | License | MIT | Doc PR | N/A Update before upcoming changes on PHP CS Fixer 1.7 To keep fabbot.io happy ;) Commits ------- ec2cec6 CS: Binary operators should be arounded by at least one space
2 parents 5a15c8d + 66ceb12 commit 18435f2

File tree

8 files changed

+27
-27
lines changed

8 files changed

+27
-27
lines changed

Acl/Dbal/AclProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function findAcls(array $oids, array $sids = array())
104104
$currentBatch = array();
105105
$oidLookup = array();
106106

107-
for ($i = 0, $c = count($oids); $i<$c; $i++) {
107+
for ($i = 0, $c = count($oids); $i < $c; $i++) {
108108
$oid = $oids[$i];
109109
$oidLookupKey = $oid->getIdentifier().$oid->getType();
110110
$oidLookup[$oidLookupKey] = $oid;
@@ -313,7 +313,7 @@ protected function getAncestorLookupSql(array $batch)
313313
$this->connection->quote($batch[$i]->getType())
314314
);
315315

316-
if ($i+1 < $count) {
316+
if ($i + 1 < $count) {
317317
$sql .= ' OR ';
318318
}
319319
}

Acl/Dbal/MutableAclProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ private function updateNewFieldAceProperty($name, array $changes)
786786
$sids = new \SplObjectStorage();
787787
$classIds = new \SplObjectStorage();
788788
foreach ($changes[1] as $field => $new) {
789-
for ($i = 0, $c = count($new); $i<$c; $i++) {
789+
for ($i = 0, $c = count($new); $i < $c; $i++) {
790790
$ace = $new[$i];
791791

792792
if (null === $ace->getId()) {
@@ -860,7 +860,7 @@ private function updateNewAceProperty($name, array $changes)
860860

861861
$sids = new \SplObjectStorage();
862862
$classIds = new \SplObjectStorage();
863-
for ($i = 0, $c = count($new); $i<$c; $i++) {
863+
for ($i = 0, $c = count($new); $i < $c; $i++) {
864864
$ace = $new[$i];
865865

866866
if (null === $ace->getId()) {
@@ -901,7 +901,7 @@ private function updateOldAceProperty($name, array $changes)
901901
list($old, $new) = $changes;
902902
$currentIds = array();
903903

904-
for ($i = 0, $c = count($new); $i<$c; $i++) {
904+
for ($i = 0, $c = count($new); $i < $c; $i++) {
905905
$ace = $new[$i];
906906

907907
if (null !== $ace->getId()) {

Acl/Domain/Acl.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ private function deleteAce($property, $index)
415415
$this->$property = array_values($this->$property);
416416
$this->onPropertyChanged($property, $oldValue, $this->$property);
417417

418-
for ($i = $index, $c = count($this->$property); $i<$c; $i++) {
419-
$this->onEntryPropertyChanged($aces[$i], 'aceOrder', $i+1, $i);
418+
for ($i = $index, $c = count($this->$property); $i < $c; $i++) {
419+
$this->onEntryPropertyChanged($aces[$i], 'aceOrder', $i + 1, $i);
420420
}
421421
}
422422

@@ -441,8 +441,8 @@ private function deleteFieldAce($property, $index, $field)
441441
$aces[$field] = array_values($aces[$field]);
442442
$this->onPropertyChanged($property, $oldValue, $this->$property);
443443

444-
for ($i = $index, $c = count($aces[$field]); $i<$c; $i++) {
445-
$this->onEntryPropertyChanged($aces[$field][$i], 'aceOrder', $i+1, $i);
444+
for ($i = $index, $c = count($aces[$field]); $i < $c; $i++) {
445+
$this->onEntryPropertyChanged($aces[$field][$i], 'aceOrder', $i + 1, $i);
446446
}
447447
}
448448

@@ -486,8 +486,8 @@ private function insertAce($property, $index, $mask, SecurityIdentityInterface $
486486
array_slice($this->$property, $index)
487487
);
488488

489-
for ($i = $index, $c = count($this->$property)-1; $i<$c; $i++) {
490-
$this->onEntryPropertyChanged($aces[$i+1], 'aceOrder', $i, $i+1);
489+
for ($i = $index, $c = count($this->$property) - 1; $i < $c; $i++) {
490+
$this->onEntryPropertyChanged($aces[$i + 1], 'aceOrder', $i, $i + 1);
491491
}
492492
}
493493

@@ -544,8 +544,8 @@ private function insertFieldAce($property, $index, $field, $mask, SecurityIdenti
544544
array_slice($aces[$field], $index)
545545
);
546546

547-
for ($i = $index, $c = count($aces[$field])-1; $i<$c; $i++) {
548-
$this->onEntryPropertyChanged($aces[$field][$i+1], 'aceOrder', $i, $i+1);
547+
for ($i = $index, $c = count($aces[$field]) - 1; $i < $c; $i++) {
548+
$this->onEntryPropertyChanged($aces[$field][$i + 1], 'aceOrder', $i, $i + 1);
549549
}
550550
}
551551

Acl/Permission/MaskBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function getPattern()
128128
$length = strlen($pattern);
129129
$bitmask = str_pad(decbin($this->mask), $length, '0', STR_PAD_LEFT);
130130

131-
for ($i = $length-1; $i >= 0; $i--) {
131+
for ($i = $length - 1; $i >= 0; $i--) {
132132
if ('1' === $bitmask[$i]) {
133133
try {
134134
$pattern[$i] = self::getCode(1 << ($length - $i - 1));

Core/Authentication/Token/AbstractToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public function setAttribute($name, $value)
235235
public function __toString()
236236
{
237237
$class = get_class($this);
238-
$class = substr($class, strrpos($class, '\\')+1);
238+
$class = substr($class, strrpos($class, '\\') + 1);
239239

240240
$roles = array();
241241
foreach ($this->roles as $role) {

Tests/Acl/Dbal/AclProviderBenchmarkTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected function generateTestData()
9292
$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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
9393
$this->insertOidAncestorStmt = $this->con->prepare('INSERT INTO acl_object_identity_ancestors (object_identity_id, ancestor_id) VALUES (?, ?)');
9494

95-
for ($i = 0; $i<40000; $i++) {
95+
for ($i = 0; $i < 40000; $i++) {
9696
$this->generateAclHierarchy();
9797
}
9898
}
@@ -107,7 +107,7 @@ protected function generateAclHierarchy()
107107
protected function generateAclLevel($depth, $parentId, $ancestors)
108108
{
109109
$level = count($ancestors);
110-
for ($i = 0, $t = rand(1, 10); $i<$t; $i++) {
110+
for ($i = 0, $t = rand(1, 10); $i < $t; $i++) {
111111
$id = $this->generateAcl($this->chooseClassId(), $parentId, $ancestors);
112112

113113
if ($level < $depth) {
@@ -124,9 +124,9 @@ protected function chooseClassId()
124124
$this->insertClassStmt->execute(array($id, $this->getRandomString(rand(20, 100), 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\\_')));
125125
++$id;
126126

127-
return $id-1;
127+
return $id - 1;
128128
} else {
129-
return rand(1000, $id-1);
129+
return rand(1000, $id - 1);
130130
}
131131
}
132132

@@ -150,7 +150,7 @@ protected function generateAcl($classId, $parentId, $ancestors)
150150
$this->generateAces($classId, $id);
151151
++$id;
152152

153-
return $id-1;
153+
return $id - 1;
154154
}
155155

156156
protected function chooseSid()
@@ -165,9 +165,9 @@ protected function chooseSid()
165165
));
166166
++$id;
167167

168-
return $id-1;
168+
return $id - 1;
169169
} else {
170-
return rand(1000, $id-1);
170+
return rand(1000, $id - 1);
171171
}
172172
}
173173

@@ -185,7 +185,7 @@ protected function generateAces($classId, $objectId)
185185
$sid = $this->chooseSid();
186186
} while (array_key_exists($sid, $sids) && in_array($fieldName, $sids[$sid], true));
187187

188-
$fieldOrder[$fieldName] = array_key_exists($fieldName, $fieldOrder) ? $fieldOrder[$fieldName]+1 : 0;
188+
$fieldOrder[$fieldName] = array_key_exists($fieldName, $fieldOrder) ? $fieldOrder[$fieldName] + 1 : 0;
189189
if (!isset($sids[$sid])) {
190190
$sids[$sid] = array();
191191
}
@@ -238,7 +238,7 @@ protected function getRandomString($length, $chars = 'abcdefghijklmnopqrstuvwxyz
238238
$cLength = strlen($chars);
239239

240240
while (strlen($s) < $length) {
241-
$s .= $chars[mt_rand(0, $cLength-1)];
241+
$s .= $chars[mt_rand(0, $cLength - 1)];
242242
}
243243

244244
return $s;

Tests/Core/Util/SecureRandomTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testPoker($secureRandom)
4949
$f += $c[$i] * $c[$i];
5050
}
5151

52-
$Y = 16/5000 * $f - 5000;
52+
$Y = 16 / 5000 * $f - 5000;
5353

5454
$this->assertTrue($Y > 1.03 && $Y < 57.4, 'Poker test failed, Y = '.$Y);
5555
}

Tests/Http/RememberMe/TokenBasedRememberMeServicesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testAutoLoginThrowsExceptionOnNonExistentUser()
4343
$userProvider = $this->getProvider();
4444
$service = $this->getService($userProvider, array('name' => 'foo', 'path' => null, 'domain' => null, 'always_remember_me' => true, 'lifetime' => 3600));
4545
$request = new Request();
46-
$request->cookies->set('foo', $this->getCookie('fooclass', 'foouser', time()+3600, 'foopass'));
46+
$request->cookies->set('foo', $this->getCookie('fooclass', 'foouser', time() + 3600, 'foopass'));
4747

4848
$userProvider
4949
->expects($this->once())
@@ -129,7 +129,7 @@ public function testAutoLogin()
129129

130130
$service = $this->getService($userProvider, array('name' => 'foo', 'always_remember_me' => true, 'lifetime' => 3600));
131131
$request = new Request();
132-
$request->cookies->set('foo', $this->getCookie('fooclass', 'foouser', time()+3600, 'foopass'));
132+
$request->cookies->set('foo', $this->getCookie('fooclass', 'foouser', time() + 3600, 'foopass'));
133133

134134
$returnedToken = $service->autoLogin($request);
135135

0 commit comments

Comments
 (0)