简体   繁体   中英

PhpStorm - double indentation for arrays

I am one of many developers who prefer tab indentation over spaces, regardless what FIG recommends or sets as standard.

I have set up PhpStorm a few days ago and I'm evaluating it (I use PDT Eclipse).

I have one issue, which is extremely annoying in PHP Storm and I can't seem to find a setting or a solution to it:

I like to indent arrays with 2 tabs and also close the brackets with the same indentation as the keys of the array (see example below). Is there a way to have PhpStorm use this kind of indentation or at least to stop it from forcing its own indentation in arrays?

$arr = array(
        'key1' => 'value1',
        'arr1' => array(
                'key2' => 'value2',
                ),
        );

You would need to set up double indentation in code style. But that would make double indents everywhere. Even though I understand it does not answer your question I would suggest to stick to sensible approach and use only one tab everywhere (maybe setting 8 space wide tabs).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM