Skip to content

Commit

Permalink
bug PHP-CS-Fixer#5033 VoidReturnFixer - must run after NoSuperfluousP…
Browse files Browse the repository at this point in the history
…hpdocTagsFixer (kubawerlos)

This PR was merged into the 2.15 branch.

Discussion
----------

VoidReturnFixer - must run after NoSuperfluousPhpdocTagsFixer

Commits
-------

f27a841 VoidReturnFixer - must run after NoSuperfluousPhpdocTagsFixer
  • Loading branch information
SpacePossum committed Jul 3, 2020
2 parents a559874 + f27a841 commit 70c4714
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Fixer/FunctionNotation/VoidReturnFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function getDefinition()
*/
public function getPriority()
{
return 5;
return 3;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function foo() {}
*/
public function getPriority()
{
return 10;
return 4;
}

/**
Expand Down
1 change: 1 addition & 0 deletions tests/AutoReview/FixerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']],
Expand Down
Original file line number Diff line number Diff line change
@@ -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--
<?php
/**
*/
function test(): void {}

--INPUT--
<?php
/**
* @return mixed
*/
function test() {}

0 comments on commit 70c4714

Please sign in to comment.