Skip to content

Commit c2e7ce3

Browse files
committed
Appease newer PHPStan
1 parent 766ea5e commit c2e7ce3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

MO4/Sniffs/Arrays/ArrayDoubleArrowAlignmentSniff.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ public function process(File $phpcsFile, $stackPtr): void
108108
continue;
109109
}
110110

111+
$i = (int) $i;
112+
111113
if ($current['code'] === T_DOUBLE_ARROW) {
112114
$assignments[] = $i;
113115
$column = $previous['column'];
@@ -136,7 +138,7 @@ public function process(File $phpcsFile, $stackPtr): void
136138

137139
$hasKeyInLine = false;
138140

139-
$j = ((int) $i - 1);
141+
$j = ($i - 1);
140142
while (($j >= 0) && ($tokens[$j]['line'] === $current['line'])) {
141143
if (\in_array($tokens[$j]['code'], PHP_CodeSniffer_Tokens::$emptyTokens, true) === false) {
142144
$hasKeyInLine = true;

0 commit comments

Comments
 (0)