Incorrect indentation for multiple open parentheses on the same line
register_post_type( 'movie', array(
'label' => 'Movies',
'public' => true
) );
is transformed into:
register_post_type( 'movie', array(
'label' => 'Movies',
'public' => true
) );
If I add another pair of parentheses, the effect will be even more pronounced. This:
register_post_type( 'movie', ( array(
'label' => 'Movies',
'supports' => array( 'foo', 'bar' )
) ) );
will become:
register_post_type( 'movie', ( array(
'label' => 'Movies',
'supports' => array( 'foo', 'bar' )
) ) );
and so on.
The problem is that the two '(' on the register_post_type line are counted as two indentation levels, even if they're on the same line.
What should those examples produce?
When passing the first code block through wp-phptidy, it should remain unchanged.
Ok, thanks.
:+1:
it should indent only once in case of arrays inside functions or also anonymous functions:
Class::something( ..., function(){
$do->other->stuff( 'here' );
});
right now:
Class::something( ..., function()
{
$do->other->stuff( 'here' );
} );
should be:
Class::something( ..., function() {
$do->other->stuff( 'here' );
} );
another issue is indenting of arrays over multiple lines:
$array = function(array(
'something' => 'in here',
'something' => 'in here'
));
right now this happens because of the two round braces, same as with the anonymous function:
$array = function( array(
'something' => 'in here',
'something' => 'in here'
) );
it should become:
$array = function( array(
'something' => 'in here',
'something' => 'in here'
) );