Let's get started by installing the Symfony2 Plugin and checking how we can enable Symfony2-specific features in our PHP projects.
Installing the Symfony2 Plugin
The Symfony2 Plugin can be installed from within our IDE from IDE Settings | Plugins. Here we can see the list of installed plugins and browse third-party plugin repositories using the Browse repositories... button. Feel free to explore several of the other plugins in there.
After clicking Browse repositories..., search for Symfony2 and select the Symfony2 Plugin. This will show the plugin description. Click the Install Plugin button and confirm plugin installation to continue.
Once we save the settings, PhpStorm will ask us if we want to restart the IDE. We must do this to activate and load the plugin.
Enabling the Symfony2 Plugin for a project
The plugin, even after installing it in the IDE, will not do its magic until after we explicitly enable it for the project. After creating or opening a Symfony2 project in PhpStorm, the IDE will show us a pop-up with instructions on how we can enable the plugin.
We can click the Project Settings hyperlink, or alternatively go through Project Settings | Symfony2 Plugin and select the check-box Enable Plugin for this Project. Clicking OK will save our changes to the settings. Note that PhpStorm will have to be restarted for the plugin to pick up this change in configuration.
After restarting PhpStorm, we're good to go!
Symfony2 Code Style
Pre-configured Symfony2 Code Style has been available in PhpStorm for a while. It can be configured through Project Settings | Code Style | PHP | Set From... | Predefined Style | Symfony2. Setting the Symfony2 Code Style ensures PhpStorm adheres to the style guidelines described in the Symfony2 Coding Standards.