Skip to content

Commit 94ae514

Browse files
committed
minor #14121 CS: Pre incrementation/decrementation should be used if possible (gharlan)
This PR was merged into the 2.3 branch. Discussion ---------- CS: Pre incrementation/decrementation should be used if possible | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Fixes provided by new fixer: PHP-CS-Fixer/PHP-CS-Fixer#1113 If this pr is merged I would change the level of the fixer to `symfony`. Commits ------- c5123d6 CS: Pre incrementation/decrementation should be used if possible
2 parents f4b9a18 + 5104a0e commit 94ae514

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Command/ContainerDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ protected function validateInput(InputInterface $input)
143143
$optionsCount = 0;
144144
foreach ($options as $option) {
145145
if ($input->getOption($option)) {
146-
$optionsCount++;
146+
++$optionsCount;
147147
}
148148
}
149149

Templating/Helper/CodeHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function fileExcerpt($file, $line)
135135
$content = preg_split('#<br />#', $code);
136136

137137
$lines = array();
138-
for ($i = max($line - 3, 1), $max = min($line + 3, count($content)); $i <= $max; $i++) {
138+
for ($i = max($line - 3, 1), $max = min($line + 3, count($content)); $i <= $max; ++$i) {
139139
$lines[] = '<li'.($i == $line ? ' class="selected"' : '').'><code>'.self::fixCodeMarkup($content[$i - 1]).'</code></li>';
140140
}
141141

Translation/PhpExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ protected function parseTokens($tokens, MessageCatalogue $catalog)
148148
{
149149
$tokenIterator = new \ArrayIterator($tokens);
150150

151-
for ($key = 0; $key < $tokenIterator->count(); $key++) {
151+
for ($key = 0; $key < $tokenIterator->count(); ++$key) {
152152
foreach ($this->sequences as $sequence) {
153153
$message = '';
154154
$tokenIterator->seek($key);

0 commit comments

Comments
 (0)