diff --git a/src/Fixer/Phpdoc/AlignMultilineCommentFixer.php b/src/Fixer/Phpdoc/AlignMultilineCommentFixer.php index 3ac63a8d5a4..8ef7f0b0516 100644 --- a/src/Fixer/Phpdoc/AlignMultilineCommentFixer.php +++ b/src/Fixer/Phpdoc/AlignMultilineCommentFixer.php @@ -86,6 +86,7 @@ public function getDefinition() /** * {@inheritdoc} * + * Must run before PhpdocTrimConsecutiveBlankLineSeparationFixer. * Must run after ArrayIndentationFixer. */ public function getPriority() diff --git a/src/Fixer/Phpdoc/PhpdocAlignFixer.php b/src/Fixer/Phpdoc/PhpdocAlignFixer.php index e9fef55cc34..303b933ec87 100644 --- a/src/Fixer/Phpdoc/PhpdocAlignFixer.php +++ b/src/Fixer/Phpdoc/PhpdocAlignFixer.php @@ -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; } /** diff --git a/src/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixer.php b/src/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixer.php index 1c633a82698..edf17593c06 100644 --- a/src/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixer.php +++ b/src/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixer.php @@ -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; } /** diff --git a/tests/AutoReview/FixerFactoryTest.php b/tests/AutoReview/FixerFactoryTest.php index ca887efae5a..dcd0f473167 100644 --- a/tests/AutoReview/FixerFactoryTest.php +++ b/tests/AutoReview/FixerFactoryTest.php @@ -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']], diff --git a/tests/Fixtures/Integration/priority/align_multiline_comment,phpdoc_trim_consecutive_blank_line_separation.test b/tests/Fixtures/Integration/priority/align_multiline_comment,phpdoc_trim_consecutive_blank_line_separation.test new file mode 100644 index 00000000000..57951f53cec --- /dev/null +++ b/tests/Fixtures/Integration/priority/align_multiline_comment,phpdoc_trim_consecutive_blank_line_separation.test @@ -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-- +