Skip to content

Commit

Permalink
DX: code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Mar 3, 2021
1 parent 6d1e66f commit c323eb6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,14 @@ private function splitUpDocBlock($lines, Tokens $tokens, $docBlockIndex)
}

/**
* @param Line []$line
* @param Line[] $lines
*
* @return string
*/
private function getSingleLineDocBlockEntry($line)
private function getSingleLineDocBlockEntry(array $lines)
{
$line = $line[0];
$line = str_replace('*/', '', $line);
$line = $lines[0];
$line = str_replace('*/', '', $line->getContent());
$line = trim($line);
$line = str_split($line);
$i = \count($line);
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/Whitespace/NoExtraBlankLinesFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ private function removeBetweenUse($index)
return;
}

return $this->removeEmptyLinesAfterLineWithTokenAt($next);
$this->removeEmptyLinesAfterLineWithTokenAt($next);
}

private function removeMultipleBlankLines($index)
Expand Down
2 changes: 1 addition & 1 deletion src/Runner/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResu
sprintf('Failed to write file "%s", "%s".', $fileName, $error ? $error['message'] : 'no reason available'),
0,
null,
$file
$fileName
);
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/Tokenizer/Tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,18 @@ public static function getBlockEdgeDefinitions()
* Set new size of collection.
*
* @param int $size
*
* @return bool
*/
public function setSize($size)
{
if ($this->getSize() !== $size) {
$this->changed = true;
parent::setSize($size);

return parent::setSize($size);
}

return true;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testFixWithDifferentLineEndings($expected, $input = null, array
$input = str_replace("\n", "\r\n", $input);
}

return $this->testFix(
$this->testFix(
str_replace("\n", "\r\n", $expected),
$input,
$configuration
Expand Down

0 comments on commit c323eb6

Please sign in to comment.