diff --git a/src/Fixer/FunctionNotation/VoidReturnFixer.php b/src/Fixer/FunctionNotation/VoidReturnFixer.php index 7f6107e4a77..00eba40b5b4 100644 --- a/src/Fixer/FunctionNotation/VoidReturnFixer.php +++ b/src/Fixer/FunctionNotation/VoidReturnFixer.php @@ -50,11 +50,11 @@ public function getDefinition() * {@inheritdoc} * * Must run before PhpdocNoEmptyReturnFixer, ReturnTypeDeclarationFixer. - * Must run after SimplifiedNullReturnFixer. + * Must run after NoSuperfluousPhpdocTagsFixer, SimplifiedNullReturnFixer. */ public function getPriority() { - return 15; + return 5; } /** diff --git a/src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php b/src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php index 9545ff437f2..2e3feedd7e7 100644 --- a/src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php +++ b/src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php @@ -42,7 +42,7 @@ public function getDefinition() */ public function getPriority() { - return 5; + return 3; } /** diff --git a/src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php b/src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php index ef92cd53c53..83af2b98d69 100644 --- a/src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php +++ b/src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php @@ -82,7 +82,7 @@ class Foo { /** * {@inheritdoc} * - * Must run before NoEmptyPhpdocFixer, PhpdocAlignFixer. + * Must run before NoEmptyPhpdocFixer, PhpdocAlignFixer, VoidReturnFixer. * Must run after CommentToPhpdocFixer, FullyQualifiedStrictTypesFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocIndentFixer, PhpdocReturnSelfReferenceFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocToReturnTypeFixer, PhpdocTypesFixer. */ public function getPriority() diff --git a/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php b/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php index 774f8ec8f3e..2e394e3c1f0 100644 --- a/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php +++ b/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php @@ -69,7 +69,7 @@ function foo() {} */ public function getPriority() { - return 10; + return 4; } /** diff --git a/tests/AutoReview/FixerFactoryTest.php b/tests/AutoReview/FixerFactoryTest.php index dcd0f473167..32bd273d7b7 100644 --- a/tests/AutoReview/FixerFactoryTest.php +++ b/tests/AutoReview/FixerFactoryTest.php @@ -153,6 +153,7 @@ public function provideFixersPriorityCases() [$fixers['no_spaces_after_function_name'], $fixers['function_to_constant']], [$fixers['no_spaces_inside_parenthesis'], $fixers['function_to_constant']], [$fixers['no_superfluous_phpdoc_tags'], $fixers['no_empty_phpdoc']], + [$fixers['no_superfluous_phpdoc_tags'], $fixers['void_return']], [$fixers['no_unneeded_control_parentheses'], $fixers['no_trailing_whitespace']], [$fixers['no_unneeded_curly_braces'], $fixers['no_useless_else']], [$fixers['no_unneeded_curly_braces'], $fixers['no_useless_return']], diff --git a/tests/Fixtures/Integration/priority/no_superfluous_phpdoc_tags,void_return.test b/tests/Fixtures/Integration/priority/no_superfluous_phpdoc_tags,void_return.test new file mode 100644 index 00000000000..c755a30586e --- /dev/null +++ b/tests/Fixtures/Integration/priority/no_superfluous_phpdoc_tags,void_return.test @@ -0,0 +1,18 @@ +--TEST-- +Integration of fixers: no_superfluous_phpdoc_tags,void_return. +--RULESET-- +{"no_superfluous_phpdoc_tags": true, "void_return": true} +--REQUIREMENTS-- +{"php": 70100} +--EXPECT-- +