Skip to content

Commit 26ff3a7

Browse files
committed
CS: Pre incrementation/decrementation should be used if possible
1 parent 271c8f1 commit 26ff3a7

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Expression/Glob.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function toRegex($strictLeadingDot = true, $strictWildcardSlash = true)
105105
$inCurlies = 0;
106106
$regex = '';
107107
$sizeGlob = strlen($this->pattern);
108-
for ($i = 0; $i < $sizeGlob; $i++) {
108+
for ($i = 0; $i < $sizeGlob; ++$i) {
109109
$car = $this->pattern[$i];
110110
if ($firstByte) {
111111
if ($strictLeadingDot && '.' !== $car) {

Glob.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function toRegex($glob, $strictLeadingDot = true, $strictWildcardS
5151
$inCurlies = 0;
5252
$regex = '';
5353
$sizeGlob = strlen($glob);
54-
for ($i = 0; $i < $sizeGlob; $i++) {
54+
for ($i = 0; $i < $sizeGlob; ++$i) {
5555
$car = $glob[$i];
5656
if ($firstByte) {
5757
if ($strictLeadingDot && '.' !== $car) {

Tests/FinderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ public function testCountDirectories()
466466
$i = 0;
467467

468468
foreach ($directory as $dir) {
469-
$i++;
469+
++$i;
470470
}
471471

472472
$this->assertCount($i, $directory);
@@ -478,7 +478,7 @@ public function testCountFiles()
478478
$i = 0;
479479

480480
foreach ($files as $file) {
481-
$i++;
481+
++$i;
482482
}
483483

484484
$this->assertCount($i, $files);

Tests/Iterator/FilterIteratorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testFilterFilesystemIterators()
3131

3232
$c = 0;
3333
foreach ($i as $item) {
34-
$c++;
34+
++$c;
3535
}
3636

3737
$this->assertEquals(1, $c);
@@ -40,7 +40,7 @@ public function testFilterFilesystemIterators()
4040

4141
$c = 0;
4242
foreach ($i as $item) {
43-
$c++;
43+
++$c;
4444
}
4545

4646
// This would fail with \FilterIterator but works with Symfony\Component\Finder\Iterator\FilterIterator

0 commit comments

Comments
 (0)