Skip to content

Commit 5f240a3

Browse files
committed
Merge branch '2.15' into 2.16
* 2.15: DX: add missing priority tests Remove useless priority comments Remove false test skip
2 parents 0b5f3b6 + a8385e5 commit 5f240a3

12 files changed

+95
-33
lines changed

src/Fixer/Import/NoLeadingImportSlashFixer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public function getDefinition()
4444
*/
4545
public function getPriority()
4646
{
47-
// should be run after the SingleImportPerStatementFixer (for fix separated use statements as well) and NoUnusedImportsFixer (just for save performance)
4847
return -20;
4948
}
5049

src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function getDefinition()
3737
/**
3838
* {@inheritdoc}
3939
*
40-
* Must run before MultilineWhitespaceBeforeSemicolonsFixer, NoSpacesInsideParenthesisFixer, NoTrailingWhitespaceFixer, NoWhitespaceInBlankLineFixer.
40+
* Must run before MultilineWhitespaceBeforeSemicolonsFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer, NoSpacesInsideParenthesisFixer, NoTrailingWhitespaceFixer, NoWhitespaceInBlankLineFixer.
4141
*/
4242
public function getPriority()
4343
{

src/Fixer/Operator/StandardizeIncrementFixer.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ public function getDefinition()
5959
*/
6060
public function getPriority()
6161
{
62-
// Must be run before IncrementStyleFixer in case user wants to
63-
// post-increment instead
6462
return 1;
6563
}
6664

src/Fixer/Phpdoc/PhpdocIndentFixer.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@ class DocBlocks
5353
*/
5454
public function getPriority()
5555
{
56-
/*
57-
* Should be run before all other docblock fixers apart from the
58-
* phpdoc_to_comment fixer to make sure all fixers apply correct
59-
* indentation to new code they add, and the phpdoc_params fixer only
60-
* works on correctly indented docblocks. We also need to be running
61-
* after the psr2 indentation fixer for obvious reasons.
62-
* comments.
63-
*/
6456
return 20;
6557
}
6658

src/Fixer/Phpdoc/PhpdocOrderFixer.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ public function getDefinition()
6565
*/
6666
public function getPriority()
6767
{
68-
/*
69-
* Should be run before the php_doc_separation fixer so that if we
70-
* create incorrect annotation grouping while moving the annotations
71-
* about, we're still ok.
72-
*/
7368
return -2;
7469
}
7570

src/Fixer/Phpdoc/PhpdocTrimFixer.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ final class Foo {}
5151
*/
5252
public function getPriority()
5353
{
54-
/*
55-
* Should be run after all phpdoc fixers that add or remove tags, or
56-
* alter descriptions. This is so that they don't leave behind blank
57-
* lines this fixer would have otherwise cleaned up.
58-
*/
5954
return -5;
6055
}
6156

src/Fixer/Semicolon/NoSinglelineWhitespaceBeforeSemicolonsFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function getDefinition()
3737
/**
3838
* {@inheritdoc}
3939
*
40-
* Must run after FunctionToConstantFixer, NoEmptyStatementFixer, SingleImportPerStatementFixer.
40+
* Must run after CombineConsecutiveIssetsFixer, FunctionToConstantFixer, NoEmptyStatementFixer, SingleImportPerStatementFixer.
4141
*/
4242
public function getPriority()
4343
{

tests/AutoReview/FixerFactoryTest.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public function provideFixersPriorityCases()
7474
[$fixers['class_attributes_separation'], $fixers['indentation_type']],
7575
[$fixers['class_keyword_remove'], $fixers['no_unused_imports']],
7676
[$fixers['combine_consecutive_issets'], $fixers['multiline_whitespace_before_semicolons']],
77+
[$fixers['combine_consecutive_issets'], $fixers['no_singleline_whitespace_before_semicolons']],
7778
[$fixers['combine_consecutive_issets'], $fixers['no_spaces_inside_parenthesis']],
7879
[$fixers['combine_consecutive_issets'], $fixers['no_trailing_whitespace']],
7980
[$fixers['combine_consecutive_issets'], $fixers['no_whitespace_in_blank_line']],
@@ -303,12 +304,8 @@ public function testFixersPriorityPairsHaveIntegrationTest(FixerInterface $first
303304
// It may only shrink, never add anything to it.
304305
$casesWithoutTests = [
305306
'indentation_type,phpdoc_indent.test',
306-
'method_separation,braces.test',
307307
'phpdoc_no_access,phpdoc_order.test',
308-
'phpdoc_no_access,phpdoc_separation.test',
309308
'phpdoc_no_package,phpdoc_order.test',
310-
'phpdoc_order,phpdoc_separation.test',
311-
'phpdoc_order,phpdoc_trim.test',
312309
];
313310

314311
$integrationTestName = $this->generateIntegrationTestName($first, $second);
@@ -416,12 +413,6 @@ public function testPriorityIntegrationTestFilesAreListedPriorityCases($fileName
416413
static::markTestIncomplete(sprintf('Case "%s" has unexpected name, please help fixing it.', $fileName));
417414
}
418415

419-
if (\in_array($fileName, [
420-
'combine_consecutive_issets,no_singleline_whitespace_before_semicolons.test',
421-
], true)) {
422-
static::markTestIncomplete(sprintf('Case "%s" is not fully handled, please help fixing it.', $fileName));
423-
}
424-
425416
static::assertSame(
426417
1,
427418
preg_match('#^([a-z][a-z0-9_]*),([a-z][a-z_]*)(?:_\d{1,3})?\.test(-(in|out)\.php)?$#', $fileName, $matches),
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
Integration of fixers: method_separation,braces.
3+
--RULESET--
4+
{"method_separation": true, "braces": true}
5+
--EXPECT--
6+
<?php
7+
8+
class Foo
9+
{
10+
/** bar */
11+
public function bar()
12+
{
13+
}
14+
15+
/** baz */
16+
public function baz()
17+
{
18+
}
19+
}
20+
21+
--INPUT--
22+
<?php
23+
24+
class Foo
25+
{
26+
/** bar */public function bar() {}/** baz */public function baz() {}
27+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
Integration of fixers: phpdoc_no_access,phpdoc_separation.
3+
--RULESET--
4+
{"phpdoc_no_access": true, "phpdoc_separation": true}
5+
--EXPECT--
6+
<?php
7+
/**
8+
* @param $foo
9+
* @param $bar
10+
*
11+
* @return bool
12+
*/
13+
14+
--INPUT--
15+
<?php
16+
/**
17+
* @access public
18+
* @param $foo
19+
* @param $bar
20+
* @return bool
21+
*/

0 commit comments

Comments
 (0)