Trying the PhpStorm 2.0 IDE
Written by Mike James   
Wednesday, 27 April 2011
Article Index
Trying the PhpStorm 2.0 IDE
Code creation and debugging

Code creation

At some point you are going to have to write some PHP and this is where the fun begins - after all code creation is so much more satisfying than debugging! The first thing that you notice using PhpStorm is the auto code completion but it doesn't end there. The code editor is extremely rich in features and you are unlikely to find the best way of using them all in the first few minutes of use so take it slowly and build up.

I'm just going to mention the few that I found immediately of use. Given how much trouble I have with spelling the built-in spellchecker saves me from many embarrassing moments - it may not be directly about code but it's something many coders really welcome. 

The code prompting includes properties and methods of any classes you have defined and you can immediately find usages of any name, declaration, implementation and so on.  You can also automatically generate overrides, getters, setters and so on.

One feature I really liked was the ability to find out what a function was overriding by hovering over the small icon that appears next to its name. 

 

override

 

And if you click on the icon you can drill down through the inheritance chain.

A structure panel shows you the methods and properties of the class you are creating including inherited methods and properties. As you might expect the editor has a lot of  help with refactoring. You can safely rename, move and delete existing elements and create new variables, methods and fields.

One of the stranger but welcome features is the multi-languge syntax support. You can mix HTML, PHP and JavaScript all on a single page and the editor not only manages to do syntax highlighting but autocomplete as well. 

One aspect of PhpStorm I haven't got into as yet is the Smarty Template engine. This has to be downloaded and setup as a separate step but PhpStorm 2.0 supports its use, including syntax highlighting, custom delimiters and so on. I have been meaning to try a template approach to creating pages and this seems like a good chance to get to grips with it - look out for another article.

PhpStorm 2.0 also has support  for automatic unit tests with the help of PHPUnit. Again, as I am working with an existing project that doesn't have any unit tests already it isn't a facility I have been able to try out but it is nice to know it is there!

Another big area I have so far avoided is source control in PHP and it is something I miss. I use it with C++ and Java but not PHP for no obvious reason other than not getting round to setting it up.  The good news is that PhpStorm supports all of the main source control packages including Git, Subversion and so on. You can customize the support to the one you choose. It also has a local history option that you can use to see what has happened to a file since you last uploaded it to the server.

 

localhistory

(click to enlarge)


There are a great many facilities that I haven't mentioned simply because I haven't explored them just yet. This is a big full featured IDE that supports not only PHP but also JavaScript and HTML.  What is important to me in using PhpStorm is that it is robust and easy to use and so far is it better than Eclipse (Helios) in both of these requirements. It debugs better than Eclipse and it provides more help in generating correct code than Eclipse - and for these two reasons I plan to stick with it.

To try PhpStorm 2.0 for yourself go to its area of the  JetBrains site:

phpstorm2

 

http://www.jetbrains.com/phpstorm/download/index.html

and click the "Download now" button to start a Free 30 day trial - there's no forms to fill,  it's a  simple matter of running the .exe file and following the steps in the Installation Wizard.

 

If you would like to be informed about new articles on I Programmer you can either follow us on Twitter or Facebook or you can subscribe to our weekly newsletter.

Banner


Developing with PHP and Eclipse (Indigo)

Find out how to make PHP development easy with the latest version of Eclipse, Indigo, and how to set up local and remote debugging.



Object-oriented HTML Generation In PHP

PHP is a programming language specifically designed to generate HTML pages but one of the topics that is rarely discussed is exactly how to do this. In this article the idea that HTML generation shoul [ ... ]


Other Articles



    Last Updated ( Wednesday, 27 April 2011 )
     
     

       
    RSS feed of all content
    I Programmer - full contents
    Copyright © 2014 i-programmer.info. All Rights Reserved.
    Joomla! is Free Software released under the GNU/GPL License.