Indentation of array values

Is there a possibility to set indentation of array values, I mean:

 $changes = array(
     'status' => 'PDF print',
     'who' => $user,
     'email' => $email,
     'phone' => $phone,
     'date' => $date
);

into
 $changes = array(
     'status'     => 'PDF print',

    'who'        => $user,
     'email'      => $email,
     'phone'      => $phone,
     'date'       => $date
);

?
-1

Hi Michał,

Almost. You can have such allignment (use option below) but not with such big gap between key and value -- it will be alligned on longest key, but will not add extra spaces like you have in your example.

Settings | Code Style | PHP | Other | Align key-value pairs

The above option will make this:

$changes = array(
     'status' => 'PDF print',
     'who'    => $user,
     'email'  => $email,
     'phone'  => $phone,
     'date'   => $date
);

while you asking for this (your own example):

 $changes = array(
     'status'     => 'PDF print',

     'who'        => $user,
     'email'      => $email,
     'phone'      => $phone,
     'date'       => $date
);
0

请先登录再写评论。