The state of Symfony2 support in IDEs
4. November 2011 in IDE, Symfony, Symfony2
I have developed a lot with Symfony2 in the last months. During this time I switched my development environment a lot too find the tools that fit my workflow as good as possible. Now we have a stable release of Symfony2 available it is time to take a look at the Symfony2-Support of my favorite PHP-IDEs.
Netbeans
Years ago Eclipse was my main IDE for PHP development. I switched to Netbeans with the version 6.5 because it was faster, more stable and got symfony 1 support in one of the 6.x versions. I never looked back. It is fast, stable and has a lot of cool features like PHPUnit-Support or the awesome code-formatter. The symfony 1 support is good, I loved to use the command-line runner and the switching between views and controllers. The PHP support is exellent and supports PHP 5.3. But there is no special support for Symfony2 projects available at the moment. I started a feature request some month ago but there is nothing new here. For a long time there was no Twig-Support either. This can be solved by installing a Plugin but it is sometime a bit buggy and unstable.
PHPStorm
I felt in love with PHPStorm when it was released in Version 1. It is even faster than Netbeans and has all features you need. Debugging-Support is pretty good, PHPUnit is integrated, Good Code-Formatting is available, PHP 5.3 is supported. The lookup of classes and files is fast and convinient. Twig is supported out of the box in the current stable version. All in all it is a great IDE to develop PHP-Projects. There is no special Symfony2 support at the moment. For me the great JavaScript- and CSS-Support is a big bonus, as I develop a lot of code with backbone.js and other JS-Stuff these days. PHPStorm isn’t free but available for reasonable prices. I never regret that I bought a license.
Eclipse
Honestly I was surprised when I checked back the PHP-/Symfony2 support of Eclipse. Two month ago I started to recheck the option to switch back to Eclipse. I was pretty surprised that there are some nice features for Symfony2 developers waiting to be discovered in Eclipse. With some additional plugins you will get a really good Symfony2-IDE. I will write a blog-post about how to setup this as soon as possible (update. Here it is: “How to build a great Eclipse-Environment for Symfony2-Development“). The highlight is definetly the Symfony2 Eclipse-Plugin. It enhance Eclipse to the most advanced Symfony2 features so far. Here are some of them:
- Autocomplete of route-names in Twig-Templates
- Code-Assist of Template-paths
- Code-Assist of Container-Services
- Annotation-Support
- Code-Assist for translations
I still don’t like the IDE itself. It takes lang to get used to it. You have to install a lot of plugins to ge a good feature set. Most of the time you will end in a plugin hell where some plugins only work with Eclipse version x another only with version y. In the end I always had more than one Eclipse-Installations (For PHP-Development, for Java-Development, for Flex-Development…). The PHP Support in general is good but the development is done pretty much out of the view of the community.
PHPEdit
As I blogged some time ago, PHPEdit is a capable PHP IDE. It has the most advaned symfony 1 support of any IDE on the market, but this is limited on symfony 1. There was a survey some days ago about what support for Symfony2 is needed, so the makers of PHPEdit started to work on it but there is nothing ready at the moment. Even Twig is not supported at the moment. As I’m using MAC OSX for private projects and Windows at work I need an IDE that supports both platforms. PHPEdit though is only available for Windows. PHPEdit isn’t free but the pricing is ok for what you will get.
Editors
There are other alternatives too. Some do not use fullfledged IDEs for developing. There are some really cool editors out there. I’m a long-time-user of Textmate but the development nearly stopped and the development of the Version 2 is promised for years now. It is only available on MAC OSX. The best multi-platform alternatives I found are Sublime Text 2 and redcar. Both are really cool. I like Sublime Text 2 most. As TextMate it can enhanced via Bundles, it is small and lightweight.
Damien said on 4. November 2011
Annotation-Support & Code-Assist of Container-Services is a must have, hope Netbeans will get those soon.
PHPStorm is a good editor but I was pissed off with bugs namespace. It is on sale right now and version 3.0 comes out soon!
Maarten said on 4. November 2011
Looking forward to that blogpost about Eclipse then, as I still use it as my editor
Robert Gruendler said on 4. November 2011
Being the author of the Eclipse plugin i’d like to note that at this point the plugin is still beta, but it’s already quite usable – despite some installation quirks which hopefully will be solved soon. As for the comparison: In Symfony 1.x times i was using textmate for my PHP development a lot, but with the full adoption of PHP 5.3 features like namespaces a simple texteditor like Textmate is simply not enough anymore in my opinion. However i have to agree that the development of PDT itself is pretty community driven, and the featureset doesn’t seem to be very OOP-targeted, that’s why i started extracting some of the general-purpose features of the Symfony plugin into a standalone PDT Extension http://bit.ly/rUTHqk.
Anton said on 4. November 2011
There is command-line supprot for symfony2 in phpStorm with autocomplete and command parameters hints. Go to File – Settings – Command Line Tool Support. Click Add and there will be symfony in drop-down list. Then select app/console file and after that you’ll have “s” shortcut in Command Line Tools Console (ctrl+shift+x) with all available symfony commands.
Juan said on 4. November 2011
What about Komodo IDE?
Kevin said on 4. November 2011
@Juan: Komodo IDE (and Edit, the free version) will provide code completion with call tips if you add the project directory to the list of autocomplete directory paths. This can be done application wide, or project specific. This feature can be used on just about any PHP library.
cordoval said on 5. November 2011
check http://www.craftitonline.com for some tips with phpstorm/symfony2 and even behat coloring
for gherkin, symfony2 theme colors, and much more
Gustavo said on 20. November 2012
Thanks for the post. Just one more question, we add the prgeross view as suggested and layout it in perspectiveExtensions to be something like this:But the current problem we have is that if we have multiple job entry, the prgeross view does not have a vertical scrollbar. I check the prgeross view in Eclipse and it actually shows the vertical scrollbar.Do you might have an idea what happened? We are using 3.7.Thanks.
Bogdan Yurov said on 25. January 2014
This article is outdated, IntellijIDEA and PHPStorm have great plugin for Symfony2.