Skip to content

Commit

Permalink
Remove usage of prefix increment operator.
Browse files Browse the repository at this point in the history
This operator is less frequently used and can be harder to understand
than the more common suffix operator.

Refs #12019
  • Loading branch information
markstory committed Apr 28, 2018
1 parent ad32913 commit 1cca695
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Core/PluginCollection.php
Expand Up @@ -131,7 +131,7 @@ public function get($name)
*/
public function next()
{
++$this->position;
$this->position++;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Filesystem/Folder.php
Expand Up @@ -662,7 +662,7 @@ public function dirsize()
$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])) {
Expand Down
2 changes: 1 addition & 1 deletion src/Utility/Text.php
Expand Up @@ -138,7 +138,7 @@ public static function tokenize($data, $separator = ',', $leftBound = '(', $righ
}
}
}
$offset = ++$tmpOffset;
$offset = $tmpOffset++;
} else {
$results[] = $buffer . mb_substr($data, $offset);
$offset = $length + 1;
Expand Down
5 changes: 3 additions & 2 deletions src/View/Helper/HtmlHelper.php
Expand Up @@ -982,10 +982,11 @@ protected function _renderCells($line, $useCount = false)
}

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;
}
}

Expand Down

0 comments on commit 1cca695

Please sign in to comment.