Symfony Plugin

Compatible with: IntelliJ IDEA PhpStorm
17.09.2017
2 294 454
Symfony Plugin Documentation | Doc on GitHub | Donate
Install
  • Activate plugin per project in "File -> Settings -> Languages & Framework -> PHP -> Symfony" or use auto configuration notification
  • (Required) Install PHP Annotations
  • (Optional) Configure a default project connection in "Remote Hosts Access / Remote Hosts" to enable support for remote files in plugin settings
  • (Optional) Ignore Symfony "cache" directory because of duplicate classes "Settings -> Project -> Directories"
  • (Optional) Install PHP Toolbox
  • (Optional) To support XLIFF translations add "*.xlf" / "*.xliff" to XML "Editor" -> "File Types"
Features: Version

This plugin supports Symfony 2, 3, 4, ...

Dependency Injection Container
  • References for services in ContainerInterface::get()
  • Detect ContainerInterface::get() result type
  • References for services, tags, events, methods, ... inside yaml, xml and php
  • Indexer to provide live editing without a compiled container
  • Tagged class indexer
Doctrine
  • ORM QueryBuilder support, including chaining and nested methods
  • References and TypeProvider for doctrine getRepository
  • TypeProvider for EntityRepository::find/findOneBy/findAll/findBy
  • Field and relations resolving and annotation and yaml
Templates/Twig
  • Template names in all file references
  • Provide Template implements and extends goto on linemarker
  • Assets file references like javascript, stylesheets and more
  • Support @Template annotations
  • Trans and transchoice support with annotator, quickquick and translation extraction action
  • References for block names (completion back since PhpStorm8)
  • Variable TypeProvider similar to php with several scopes and providers like docblocks, controller, actions, template inclusion, ...
  • Macro implements goto on linemarker
  • Filter, Function, Macro and Extension support
Forms
  • References for form types
  • Form field name references on data_class
  • References for form options, extension, ...
Routing
  • References for UrlGenerator::generate() related calls
  • Autocomplete route name in twig templates
  • Go to for routing name methods
  • CodeFolding to display real route uri instead of its name
  • Route parameter completion
Other
  • Annotator which notice unknown route, template, service, assets, ...
  • Several stub indexer to provide some live generation provider in replacement for compiled container
  • Linemarker and "Related File" to provide possible goto targets and controller action
  • Search Everywhere support and custom search for only Symfony related Symbols "Navigate > Symfony Symbol"
  • Bridge for PHP Annotations to support annotation related stuff
  • Dotenv and Docker environments variable extraction for DIC parameter
Related Plugins Contributors

Download plugin

Recent change notes

  • Drop several workarounds and deprecated usages for old PhpStorm versions
  • Migrate xml service instance annotator to inspection and prevent possible memory leaks
  • Remove configuration for all type provider og plugins settings
  • Migrate yaml parameter and class annotator into inspections
  • Migrate all yaml annotator to inspection like service instance check in constructor and calls
  • Drop for all annotator configuration of plugin settings
  • Fix global route loader was not care about annotations
  • Remove annotation route indexer and merge into main router indexer #648
  • API: Simplify usage of key index process
  • Drop Twig annotator and move to inspections: routing, translations, templates and assets
  • Introduce Twig interpolated and concat checks for string values in inspections
  • Symfony 3.4: Add support for "controller" keyword for configuring routes controllers #1023
  • Fix "trans" auto-complete not working in embed with parameters #1012

see full changelog | Donate

General usage instructions

Note that the plugin uses the app/cache/dev/appDevDebugProjectContainer.xml file to know services' class, so this file has to exists and/or be up to date :-) Also note that you need the latest PHPStorm EAP build, download at http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program