Skip to content

Commit

Permalink
Merge branch 'stable' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Sep 10, 2024
2 parents 0be3989 + ed8e596 commit 02bb60e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions PHPCSDebug/Sniffs/Debug/TokenListSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function process(File $phpcsFile, $stackPtr)
$tokens = $phpcsFile->getTokens();
$last = ($phpcsFile->numTokens - 1);

$ptrPadding = \max(3, \strlen($last));
$ptrPadding = \max(3, \strlen((string) $last));
$linePadding = \strlen($tokens[$last]['line']);
$sep = ' | ';

Expand Down Expand Up @@ -132,7 +132,7 @@ public function process(File $phpcsFile, $stackPtr)
$sep, 'L', \str_pad($token['line'], $linePadding, '0', \STR_PAD_LEFT),
$sep, 'C', \str_pad($token['column'], 3, ' ', \STR_PAD_LEFT),
$sep, 'CC', \str_pad($token['level'], 2, ' ', \STR_PAD_LEFT),
$sep, '(', \str_pad($parenthesesCount, 2, ' ', \STR_PAD_LEFT), ')',
$sep, '(', \str_pad((string) $parenthesesCount, 2, ' ', \STR_PAD_LEFT), ')',
$sep, \str_pad($token['type'], 26), // Longest token type name is 26 chars.
$sep, '[', \str_pad($token['length'], 3, ' ', \STR_PAD_LEFT), ']:',
($onlyEol === false ? ' ' : ''), $content, \PHP_EOL;
Expand Down
9 changes: 5 additions & 4 deletions Scripts/FeatureComplete/Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,19 +468,20 @@ private function markProgress($i, $total)

$current = ($i + 1);
if (($current % 60) === 0 || $current === $total) {
$padding = \strlen($total);
$padding = \strlen((string) $total);

$filling = '';
if ($current === $total) {
$lines = \ceil($current / 60);
if ($lines > 1) {
$filling = \str_repeat(' ', (($lines * 60) - $total));
$filling = \str_repeat(' ', (int) (($lines * 60) - $total));
}
}

$this->writer->toStderr(
$filling . ' ' . \str_pad($current, $padding, ' ', \STR_PAD_LEFT) . ' / ' . $total
. ' (' . \str_pad(\round(($current / $total) * 100), 3, ' ', \STR_PAD_LEFT) . '%)' . \PHP_EOL
$filling . ' ' . \str_pad((string) $current, $padding, ' ', \STR_PAD_LEFT) . ' / ' . $total
. ' (' . \str_pad((string) \round(($current / $total) * 100), 3, ' ', \STR_PAD_LEFT) . '%)'
. \PHP_EOL
);
}
}
Expand Down

0 comments on commit 02bb60e

Please sign in to comment.