Skip to content

Help with rules for method chain indentation #7319

Closed Answered by Wirone
mzur asked this question in Q&A
Discussion options

You must be logged in to vote

Did you try this?

$this
    ->putJson('/api/v1/import/abc123', [
        'parent_conflicts' => [1 => 'import', 2 => 'existing'],
    ])
    ->assertStatus(200);

The problem here is caused by array_indentation, not method_chaining_indentation itself. Since second argument of putJson() is an multiline array, it finds the initial indentation of the line (not opening [), which is $this', and tries to align the rest to it. If you add new line for the first call in the chain, it works properly:

I am not sure if we should consider this as a bug in array_indentation 🤔...

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@mzur
Comment options

@Wirone
Comment options

@mzur
Comment options

@Wirone
Comment options

@mzur
Comment options

Answer selected by mzur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants