Code Formatting Tweaks for PhpStorm 2017.2

We’re constantly trying to improve our code formatting options so that everyone gets to automatically format their code just as they like it, and PhpStorm 2017.2 is no different.

We’ve added several new formatting options in PhpStorm 2017.2:

  • Add spaces around the ?? when using the null coalesce operator using Preferences | Code Style | PHP | Spaces | Null coalesce operator
  • More flexibility adding blank lines to your code – after a closing curly brace, after the opening PHP tag in a file, and after a function declaration. You’ll find them under Preferences | Code Style | PHP | Blank Lines
  • Format if statements perfectly using New line after ‘(‘ and Place ‘)’ on one line in Preferences | Code Style | PHP | Wrapping and Braces
  • Format closures differently from other functions using the closure options added to Preferences | Code Style | PHP | Wrapping and Braces

As PHP evolves so does the exacting code formatting that we use to keep our code looking just as we like it – if there’s something missing then please let us know.

– Gary & The PhpStorm Team

 

About Gary Hockin

Gary Hockin has been creating code to power web applications for 15 years, the last three of them at an extraordinary level. He is handsome, talented, funny and articulate, and also extremely modest. Gary is a valued contributor to Zend Framework 2 and is a member of the community review team. He's married and has two wonderful children, and when he's not coding, writing about code, speaking about code or reading about code, he can usually be found in the pub playing pool.
This entry was posted in Cool Feature, Newsletter. Bookmark the permalink.