Search code examples
phpstormreformat

How to make space between variable and operator in PhpStorm?


I'm using Mac & Windows, but the code reformat works differently on Mac and Windows.

On Mac

return response()->json([
    'access_token' => $jwtToken,
    'token_type'   => 'bearer',
    'expires_in'   => Auth::guard()->factory()->getTTL() * 60
]);

On Windows

return response()->json([
    'access_token' => $jwtToken,
    'token_type' => 'bearer',
    'expires_in' => Auth::guard()->factory()->getTTL() * 60
]);

I want to reformat the code like on Mac.

How can I adjust the code reformat rule?


Solution

  • Settings->Editor->Code Style -> PHP -> Wrapping and Braces ->Array Initializer -> Align key-value pairs

    enter image description here