From there, you can customize:
Use the tabs ( Tabs and Indents , Spaces , Wrapping and Braces ) to customize exactly how much padding to give parentheses or where to place opening curly braces.
| OS | Action | Shortcut | |---|---|---| | Windows / Linux | Reformat current file or selection | Ctrl + Alt + L | | macOS | Reformat current file or selection | Cmd + Option + L | phpstorm format code
Don't reformat the whole file. Only highlight the specific lines you edited, then hit the shortcut. It keeps your diffs clean while slowly improving the codebase one block at a time.
✅ Save your team’s rules in .idea/codeStyles/ and commit them to Git. From there, you can customize: Use the tabs
Before formatting, you should ensure your IDE knows which "style" to follow. Navigate to (or PhpStorm | Settings on macOS).
Use Code → Run Code Cleanup – it applies formatting + fixes low-priority inspection warnings (e.g., convert array to short syntax). It keeps your diffs clean while slowly improving
This opens the "Reformat File" dialog. From here, you can choose to:
Here you can tweak everything:
Ctrl + Alt + I (Windows/Linux) or ⌥ + I (macOS) to fix indentation without changing other formatting. Setting Global Coding Standards