Closed czosel closed 6 years ago
So the example in #23:
$this->something->method($argument, $this->more->stuff($this->even->more->things->complicatedMethod()));
Should become
$this->something->method($argument, $this->more->stuff(
$this->even->more->things->complicatedMethod()
));
I think 🙂
@MichaelDeBoey yes, i think so too! Do you want to give this a shot? 😉
@czosel I'm not really into the codebase 😕
I'm just here because I'd like to use prettier for both my front- and backend in a Laravel project actually... 🙂
Alright, no worries 🙂 If you change your mind, i'd recomment to take a look here and otherwise you can also always ask me!
An other example here. I think it can be related to this issue:
{
- return str_replace_array('#', [
- $this->budget->name,
- $this->requester->name,
- 'justif',
- ], '# - # - #');
+ return str_replace_array(
+ '#',
+ [$this->budget->name, $this->requester->name, 'justif'],
+ '# - # - #'
+ );
}
So I started looking into this but some of the examples outline above get pretty tricky. For reference, this is how prettier (js) handles it
So, for me, your examples are:
Do you confirm?
@mgrip i also tried to implement this in #123 based on the JS implementation, but i didn't arrive at a proper solution yet. You might want to take a look :smile:
Ahhh I was wondering if we would have to use that conditionalGroup
- the docs say to use it as a last resort which scared me off haha
@mathieutu yes I agree - I'm wondering if its actually going to be possible to pretty-print in the way that PSR12 is dictating. Wanted to just give examples of how prettier-js does it for reference
Most of the examples listed in this issue should be fixed by #123 - let's open new issues for anything that might be missing.
Quoting @nicoder: