Plugin-php: Indent multiple variables value on the same level

Created on 26 Feb 2019  路  6Comments  路  Source: prettier/plugin-php

I'm sorry if this is out of scope of prettier, but I find it really handy and more beautiful if in variable blocks the values are intended on the same level. I would like to discuss this. Any if all are against this then the formatter should remove those spaces between the end of the variable and the =.

Prettier 1.16.4
PHP Plugin 0.10.0

# Suggested:
--indent-blocks

Input:

$params = $template->params;
$referer = AdditiveHelper::getReferer();
$templateDetails = AdditiveHelper::getTemplateDetails();

Output:

$params          = $template->params;
$referer         = AdditiveHelper::getReferer();
$templateDetails = AdditiveHelper::getTemplateDetails();
discussion enhancement

Most helpful comment

@evilebottnawi really? I hadn't seen any change to my files. Maybe it's broken on my end. Hmm. I'll keep that in mind and will open another issue if this happens again after this is out of WIP status

All 6 comments

Thanks for issue, i don't think we need this. But we can keep open issue for other developers and voting

+1 for this.

We have lots of constant definitions that are getting re-aligned by prettier.

@evilebottnawi so then if we don't need this, prettier-php should remove those spaces. ATM it does nothing and I have mixed intended and not intended variable blocks.

@captn3m0 it is more helpful to 馃憤 on the issue instead of saying +1 or do both to explain your use case as a comment and give a 馃憤 馃憥

@muuvmuuv we already remove spaces

@evilebottnawi really? I hadn't seen any change to my files. Maybe it's broken on my end. Hmm. I'll keep that in mind and will open another issue if this happens again after this is out of WIP status

Feel free to open issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mgrip picture mgrip  路  3Comments

aboyton picture aboyton  路  4Comments

alexander-akait picture alexander-akait  路  3Comments

nikulis picture nikulis  路  5Comments

alexander-akait picture alexander-akait  路  5Comments