Skip to content

Commit

Permalink
bug #3885 AlignMultilineCommentFixer - ArrayIndentationFixer - Priori…
Browse files Browse the repository at this point in the history
…ty (dmvdbrugge)

This PR was merged into the 2.12 branch.

Discussion
----------

AlignMultilineCommentFixer - ArrayIndentationFixer - Priority

It should run after ArrayIndentationFixer.

This fixes #3860

Commits
-------

bd51b51 Add priority to AlignMultilineCommentFixer
  • Loading branch information
SpacePossum committed Jul 10, 2018
2 parents fb4f582 + bd51b51 commit 758ff3b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Fixer/Phpdoc/AlignMultilineCommentFixer.php
Expand Up @@ -83,6 +83,15 @@ public function getDefinition()
);
}

/**
* {@inheritdoc}
*/
public function getPriority()
{
// Should run after ArrayIndentationFixer
return -40;
}

/**
* {@inheritdoc}
*/
Expand Down
1 change: 1 addition & 0 deletions tests/AutoReview/FixerFactoryTest.php
Expand Up @@ -60,6 +60,7 @@ public function provideFixersPriorityCases()

return [
[$fixers['array_indentation'], $fixers['binary_operator_spaces']],
[$fixers['array_indentation'], $fixers['align_multiline_comment']],
[$fixers['array_syntax'], $fixers['binary_operator_spaces']],
[$fixers['array_syntax'], $fixers['ternary_operator_spaces']],
[$fixers['backtick_to_shell_exec'], $fixers['escape_implicit_backslashes']],
Expand Down
@@ -0,0 +1,25 @@
--TEST--
Integration of fixers: array_indentation,align_multiline_comment.
--RULESET--
{"array_indentation": true, "align_multiline_comment": {"comment_type": "all_multiline"}}
--EXPECT--
<?php

$array = [
/*
* Aligned with the values
*/
'this' => 'is a bug',
'but' => 'this is too',
];

--INPUT--
<?php

$array = [
/*
* Aligned with the values
*/
'this' => 'is a bug',
'but' => 'this is too',
];

0 comments on commit 758ff3b

Please sign in to comment.