Browse Source

Remove usage of prefix increment operator.

This operator is less frequently used and can be harder to understand
than the more common suffix operator.

Refs #12019
Mark Story 8 years ago
parent
commit
1cca695360

+ 1 - 1
src/Core/PluginCollection.php

@@ -131,7 +131,7 @@ class PluginCollection implements Iterator, Countable
      */
     public function next()
     {
-        ++$this->position;
+        $this->position++;
     }
 
     /**

+ 1 - 1
src/Filesystem/Folder.php

@@ -662,7 +662,7 @@ class Folder
         $directory = Folder::slashTerm($this->path);
         $stack = [$directory];
         $count = count($stack);
-        for ($i = 0, $j = $count; $i < $j; ++$i) {
+        for ($i = 0, $j = $count; $i < $j; $i++) {
             if (is_file($stack[$i])) {
                 $size += filesize($stack[$i]);
             } elseif (is_dir($stack[$i])) {

+ 1 - 1
src/Utility/Text.php

@@ -138,7 +138,7 @@ class Text
                         }
                     }
                 }
-                $offset = ++$tmpOffset;
+                $offset = $tmpOffset++;
             } else {
                 $results[] = $buffer . mb_substr($data, $offset);
                 $offset = $length + 1;

+ 3 - 2
src/View/Helper/HtmlHelper.php

@@ -982,10 +982,11 @@ class HtmlHelper extends Helper
             }
 
             if ($useCount) {
+                $i += 1;
                 if (isset($cellOptions['class'])) {
-                    $cellOptions['class'] .= ' column-' . ++$i;
+                    $cellOptions['class'] .= ' column-' . $i;
                 } else {
-                    $cellOptions['class'] = 'column-' . ++$i;
+                    $cellOptions['class'] = 'column-' . $i;
                 }
             }