Skip to content

Commit

Permalink
Universal/PrecisionAlignment: set redundant default values
Browse files Browse the repository at this point in the history
These variables are only accessed within conditions and those conditions already sufficiently ensure that the variables will be set for the conditions path.

Even so, PHPStan cannot handle this, so we may as well declare sensible defaults for each of those variables to make things more explicit.
  • Loading branch information
jrfnl committed Aug 26, 2023
1 parent 3399726 commit 780c759
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ public function process(File $phpcsFile, $stackPtr)
$origContent = $tokens[$i]['orig_content'];
}

$spaces = 0;
$spaces = 0;
$length = 0;
$content = '';
$closer = '';

switch ($tokens[$i]['code']) {
case \T_WHITESPACE:
if ($this->ignoreBlankLines === true
Expand Down

0 comments on commit 780c759

Please sign in to comment.