Skip to content

Commit 4907a27

Browse files
committed
Merge branch '2.15' into 2.16
* 2.15: VoidReturnFixer - must run after NoSuperfluousPhpdocTagsFixer PhpdocTrimConsecutiveBlankLineSeparationFixer - must run after AlignMultilineCommentFixer # Conflicts: # src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php
2 parents 0ec3276 + 70c4714 commit 4907a27

10 files changed

+49
-8
lines changed

src/Fixer/FunctionNotation/VoidReturnFixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ public function getDefinition()
5050
* {@inheritdoc}
5151
*
5252
* Must run before PhpdocNoEmptyReturnFixer, ReturnTypeDeclarationFixer.
53-
* Must run after SimplifiedNullReturnFixer.
53+
* Must run after NoSuperfluousPhpdocTagsFixer, SimplifiedNullReturnFixer.
5454
*/
5555
public function getPriority()
5656
{
57-
return 15;
57+
return 5;
5858
}
5959

6060
/**

src/Fixer/Phpdoc/AlignMultilineCommentFixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public function getDefinition()
8686
/**
8787
* {@inheritdoc}
8888
*
89+
* Must run before PhpdocTrimConsecutiveBlankLineSeparationFixer.
8990
* Must run after ArrayIndentationFixer.
9091
*/
9192
public function getPriority()

src/Fixer/Phpdoc/NoEmptyPhpdocFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getDefinition()
4242
*/
4343
public function getPriority()
4444
{
45-
return 5;
45+
return 3;
4646
}
4747

4848
/**

src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function doFoo(Bar $bar, $baz /*, $qux = null */) {}
9292
/**
9393
* {@inheritdoc}
9494
*
95-
* Must run before NoEmptyPhpdocFixer, PhpdocAlignFixer.
95+
* Must run before NoEmptyPhpdocFixer, PhpdocAlignFixer, VoidReturnFixer.
9696
* Must run after CommentToPhpdocFixer, FullyQualifiedStrictTypesFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocIndentFixer, PhpdocReturnSelfReferenceFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocToParamTypeFixer, PhpdocToReturnTypeFixer, PhpdocTypesFixer.
9797
*/
9898
public function getPriority()

src/Fixer/Phpdoc/PhpdocAlignFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function getPriority()
157157
* annotations are of the correct type, and are grouped correctly
158158
* before running this fixer.
159159
*/
160-
return -21;
160+
return -42;
161161
}
162162

163163
/**

src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function foo() {}
6969
*/
7070
public function getPriority()
7171
{
72-
return 10;
72+
return 4;
7373
}
7474

7575
/**

src/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ function fnc($foo) {}
6363
* {@inheritdoc}
6464
*
6565
* Must run before PhpdocAlignFixer.
66-
* Must run after CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer.
66+
* Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer.
6767
*/
6868
public function getPriority()
6969
{
70-
return 0;
70+
return -41;
7171
}
7272

7373
/**

tests/AutoReview/FixerFactoryTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function provideFixersPriorityCases()
6161
}
6262

6363
return [
64+
[$fixers['align_multiline_comment'], $fixers['phpdoc_trim_consecutive_blank_line_separation']],
6465
[$fixers['array_indentation'], $fixers['align_multiline_comment']],
6566
[$fixers['array_indentation'], $fixers['binary_operator_spaces']],
6667
[$fixers['array_syntax'], $fixers['binary_operator_spaces']],
@@ -160,6 +161,7 @@ public function provideFixersPriorityCases()
160161
[$fixers['no_spaces_after_function_name'], $fixers['function_to_constant']],
161162
[$fixers['no_spaces_inside_parenthesis'], $fixers['function_to_constant']],
162163
[$fixers['no_superfluous_phpdoc_tags'], $fixers['no_empty_phpdoc']],
164+
[$fixers['no_superfluous_phpdoc_tags'], $fixers['void_return']],
163165
[$fixers['no_unneeded_control_parentheses'], $fixers['no_trailing_whitespace']],
164166
[$fixers['no_unneeded_curly_braces'], $fixers['no_useless_else']],
165167
[$fixers['no_unneeded_curly_braces'], $fixers['no_useless_return']],
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Integration of fixers: align_multiline_comment,phpdoc_trim_consecutive_blank_line_separation.
3+
--RULESET--
4+
{"align_multiline_comment": true, "phpdoc_trim_consecutive_blank_line_separation": true}
5+
--EXPECT--
6+
<?php
7+
/**
8+
* foo
9+
*
10+
* bar
11+
*/
12+
13+
--INPUT--
14+
<?php
15+
/**
16+
* foo
17+
*
18+
19+
* bar
20+
*/
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Integration of fixers: no_superfluous_phpdoc_tags,void_return.
3+
--RULESET--
4+
{"no_superfluous_phpdoc_tags": true, "void_return": true}
5+
--REQUIREMENTS--
6+
{"php": 70100}
7+
--EXPECT--
8+
<?php
9+
/**
10+
*/
11+
function test(): void {}
12+
13+
--INPUT--
14+
<?php
15+
/**
16+
* @return mixed
17+
*/
18+
function test() {}

0 commit comments

Comments
 (0)