Skip to content

Commit

Permalink
bug PHP-CS-Fixer#5017 PhpdocTrimConsecutiveBlankLineSeparationFixer -…
Browse files Browse the repository at this point in the history
… must run after AlignMultilineCommentFixer (kubawerlos)

This PR was merged into the 2.15 branch.

Discussion
----------

PhpdocTrimConsecutiveBlankLineSeparationFixer - must run after AlignMultilineCommentFixer

Commits
-------

556c371 PhpdocTrimConsecutiveBlankLineSeparationFixer - must run after AlignMultilineCommentFixer
  • Loading branch information
SpacePossum committed Jul 3, 2020
2 parents a8de87d + 556c371 commit a559874
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Fixer/Phpdoc/AlignMultilineCommentFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public function getDefinition()
/**
* {@inheritdoc}
*
* Must run before PhpdocTrimConsecutiveBlankLineSeparationFixer.
* Must run after ArrayIndentationFixer.
*/
public function getPriority()
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/Phpdoc/PhpdocAlignFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function getPriority()
* annotations are of the correct type, and are grouped correctly
* before running this fixer.
*/
return -21;
return -42;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ function fnc($foo) {}
* {@inheritdoc}
*
* Must run before PhpdocAlignFixer.
* Must run after CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer.
* Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer.
*/
public function getPriority()
{
return 0;
return -41;
}

/**
Expand Down
1 change: 1 addition & 0 deletions tests/AutoReview/FixerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function provideFixersPriorityCases()
}

return [
[$fixers['align_multiline_comment'], $fixers['phpdoc_trim_consecutive_blank_line_separation']],
[$fixers['array_indentation'], $fixers['align_multiline_comment']],
[$fixers['array_indentation'], $fixers['binary_operator_spaces']],
[$fixers['array_syntax'], $fixers['binary_operator_spaces']],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--TEST--
Integration of fixers: align_multiline_comment,phpdoc_trim_consecutive_blank_line_separation.
--RULESET--
{"align_multiline_comment": true, "phpdoc_trim_consecutive_blank_line_separation": true}
--EXPECT--
<?php
/**
* foo
*
* bar
*/

--INPUT--
<?php
/**
* foo
*

* bar
*/

0 comments on commit a559874

Please sign in to comment.