Skip to content

Commit a1ad766

Browse files
committed
Fix: MethodArgumentSpaceFixer must run after MethodChainingIndentationFixer
1 parent e5de921 commit a1ad766

File tree

4 files changed

+33
-3
lines changed

4 files changed

+33
-3
lines changed

src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ public function configure(array $configuration = null)
128128
/**
129129
* {@inheritdoc}
130130
*
131-
* Must run after BracesFixer, CombineNestedDirnameFixer, ImplodeCallFixer, PowToExponentiationFixer.
131+
* Must run after BracesFixer, CombineNestedDirnameFixer, ImplodeCallFixer, MethodChainingIndentationFixer, PowToExponentiationFixer.
132132
*/
133133
public function getPriority()
134134
{
135-
return -26;
135+
return -30;
136136
}
137137

138138
/**

src/Fixer/Whitespace/MethodChainingIndentationFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function getDefinition()
4040
/**
4141
* {@inheritdoc}
4242
*
43-
* Must run before ArrayIndentationFixer.
43+
* Must run before ArrayIndentationFixer, MethodArgumentSpaceFixer.
4444
* Must run after BracesFixer.
4545
*/
4646
public function getPriority()

tests/AutoReview/FixerFactoryTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public function provideFixersPriorityCases()
110110
[$fixers['list_syntax'], $fixers['binary_operator_spaces']],
111111
[$fixers['list_syntax'], $fixers['ternary_operator_spaces']],
112112
[$fixers['method_chaining_indentation'], $fixers['array_indentation']],
113+
[$fixers['method_chaining_indentation'], $fixers['method_argument_space']],
113114
[$fixers['method_separation'], $fixers['braces']],
114115
[$fixers['method_separation'], $fixers['indentation_type']],
115116
[$fixers['multiline_whitespace_before_semicolons'], $fixers['space_after_semicolon']],
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
Integration of fixers: method_chaining_indentation,method_argument_space.
3+
--RULESET--
4+
{"method_chaining_indentation": true, "method_argument_space": {"on_multiline" : "ensure_fully_multiline"}}
5+
--EXPECT--
6+
<?php
7+
function foo($foo)
8+
{
9+
$foo
10+
->bar()
11+
->baz(
12+
$x,
13+
$y
14+
)
15+
;
16+
}
17+
18+
--INPUT--
19+
<?php
20+
function foo($foo)
21+
{
22+
$foo
23+
->bar()
24+
->baz(
25+
$x,
26+
$y
27+
)
28+
;
29+
}

0 commit comments

Comments
 (0)