Tuesday, 23 April 2013
Great PHPStorm additions
Without a doubt PHPStorm is one of the best code editor environment. If you've never done that, you might want to dive into the reference at least once. Apart from the obvious features and settings I share my favorite extras.
PHPStorm has the live template feature. It exist in many other IDE as well, so you might be familiar with the term. Using abbreviations you can insert reusable code snippets into your file. A couple of great Hungarian guys created a container for lots of Drupal specific templates. You can find the project page as well as the installing instructions on d.o.
Take a deep look at the templates when you installed it. It's not just a simple template, it's multi-template. It means that many cases where the hook or api function is to define structured items the template provides you subtemplates for the array structures. It's extremely useful.
Next thing I install along with PHPStorm is PHP code sniffer and its Drupal support. You can install phpcs through PEAR. You can fund then the Drupal specific configurations in the Coder module. In PHPStorm you have to set phpcs first and then you can select the Drupal configuration. Now you can go to Code > Inspect code and analyse the files you're working on.
Then I definitely install some non-Drupal related tools. I ad Sass and CoffeeScript support. It's not just the syntax and some code completion but also the live code compiler that turns scss/sass to css and coffee to js.
If you write any HTML then Emmet is essential for you.
"Unfortunately" the rest of the great features are already in and enabled by the IDE so it should be available already.