Symfony Plugin

Compatible with: IntelliJ IDEA PhpStorm
06.08.2017
2 234 417
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 and 3

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

0.14.x: PhpStorm 2017.1+
0.13.x: PhpStorm 2016.3.1 (no support)
0.12.x: PhpStorm 2016.1 (no support)
0.11.x: PhpStorm 8, 9, 10 (no support)
0.10.x: PhpStorm 7 (no support)
0.9.x: PhpStorm 6 (no support)

0.14.150
  • Fix wrong cast in service builder class scope extraction #989
  • Support Symfony 3.3 class shortcut in yaml and xml method tag scope
0.14.149
  • Detect Twig templates when using `__invoke` controllers #980; drop some redundant template annotation code
  • Add @Template __invoke support for annotation template creation quickfix and in Twig template controller resolver #980
  • Fix "Navigate to action" on controller with __invoke doesn't work #986
  • Create template for missing template is really weird #795; replace custom dialog with more commonly JBPopupFactory
  • Provide better scope detection for Service Generator, add psr-0 class structure detection fixes: "Create Service" in project tree does nothing #978
  • Add lazy decorated service resolving to fix Argument 'decorated' of ServiceUtil.getLineMarkerForDecoratedServiceId must not be null #982
  • Add calls support for service usage indexer #890
  • Add support for Twig 2 hassers for the attribute operator #964
  • Add class completion for yaml service key to support Symfony 3.3 shortcut feature #987
  • Fix empty string indexing of Doctrine repository class; "THashSet contract violation - 25 reports & coming" #985
  • Use slash for controller subfolder which are PHP namespaces instead of filesystem style to fix autocompletion for controller names in routing files is broken for namespaced classes #961
0.14.148
  • Symfony 3.3 Fully support autowire in defaults of XML #966
  • Symfony 3.3 Arguments are not autocompleted when using the FQCN as id #968 #966
  • Symfony 4.0 Support array Kernel::getKernelParameters and array_replace #973
  • Symfony 3.3 Provide class name completion in xml service ids #967
  • Symfony 3.3 Goto definition does not support services with FQCN xml ids shortcuts #952
0.14.147
  • Fix recursive string value resolve on class fields
  • Dropping custom caret overlay listener and all extension points in favor of core parameter hints
  • Symfony 3.3 Support classes in global namespace for id shortcut #952
  • Symfony 3.3 Argument hint must support yaml id shortcut #958
  • Symfony 3.3 Arguments not detected for type and argument index inspection in yaml id shortcut #959
  • Symfony 3.3 Invalid lower case inspection for service id as class name #960
  • Autocompletion for known tag names in Definition::addTag, clearTag, hasTag #955
  • Add Twig print block support for linemarker and navigation
0.14.146
  • Reworked compiled container parser to support aliases extraction more safety for Symfony 3.3 private service debugger #618 #943
  • Fix type cast error in voter role extraction #941
  • Fix npe in service call visiting of yaml files #942
  • Fix when using a classname as service id in a routing.yml plugin is mistakenly reporting the method as of missing in Symfony 3.3 #940
  • The inner service of a decorator is always private #908
  • Add Twig variable collector for parameter of a given macro scope
  • Provide extension point a Twig variable collector
  • Dropping ContainerInterface::get usage service linemarker
  • Service indexer should known "_defaults" values of Symfony 3.3 dic component #947
  • Add parameter parser for Kernel::getKernelParameters #950
  • Add "controller.service_arguments" and new yaml service keys completion of Symfony 3.3
  • Service argument inspection must respect _default configuration #948
  • Service generator for YAML files extract indent from file scope #533 #374 #362 #736
  • Action generator menu should also display service generator for yaml files and reduce visibility for valid file scope
0.14.145
  • Reduce blacklist of all file indexes; only ending with "Test" blocks processing now #897
  • Fix translation domain name extraction on empty filename #927
  • Provide ternary and better string value detection for form getParent and getExtendedType
  • Globally support string value resolve for class constant
0.14.144
  • Migrate MethodSignatureTypeProvider to PhpTypeProvider3; prevent cross plugin issue #926 #792
0.14.143
  • Add Twig form_theme indexer and provide targets in linemarker #920
  • ContainerInterface::get doesn't resolve on multiple parameter; drop parameter length check #916
  • Move PHP Annotation plugin `de.espend.idea.php.annotation` from soft to hard dependency to drop duplicate code usages #448
  • Use new PhpTypeProvider3 and replace deprecated usages in Container::get, ObjectManager::get, EventDispatcherInterface::dispatch #792
  • Refactoring of Twig macro logic, provide tests, use indexer #924
  • Add completion for Twig macros after DOT element for "import as" function #924
  • Drop regex from Twig set variable collector
  • Migrate Doctrine type provider to PhpTypeProvider3 implementation #792
  • Refactoring of ObjectManager::findBy* references and support more possible repository usages #925 #898
0.14.142
  • Implement environment variables references for %env(*) on .env and Docker files #910
  • Add Twig trans and transchoice tag support for translation keys #459
0.14.141
  • Parameter Hints must not be provided if plugin is not enabled #896
  • Fix cache folder detection in project auto configuration process #810 @20uf
  • Add navigate to Twig "include" file references #889 and use lazy value provider for better performance #809
  • Support of resname attribute in xlf trans-unit tag #913
  • Fix pattern for Yaml method "calls" #755 and implement named services support
  • Provide parameter type hint for xml and yaml "call" tags
0.14.140
  • Add class navigation for named yaml service keys of Symfony 3.3 #902
  • Add Parameter Hints for YAML and XML service arguments and dropping caret text overlay #896

open full changelog

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