Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
@Annotation 
Daniel Espendiller 
espend.de - daniel@espendiller.net
Symfony2 Plugin 
2013-03 - Downloads: ~900.000 - daily usage: 20.000 – 40.000 
PHP Annotations 
2013-09 - daily usage: ~15...
● About PhpStorm / IntelliJ 
● IntelliJ: Java Lexer / Pattern 
● IntelliJ: Extension Points 
● PhpStorm Plugin Overview 
●...
PhpStorm / IntelliJ 
● PhpStorm based on IntelliJ IDEA (Java) 
– With plugins: PHP, Twig, Yaml, … 
● „PhpStorm 1.0 & WebSt...
PhpStorm / IntelliJ 
● PhpTypeProvider2 (ContainerInterface::get) 
– PhpTypeProvider(1) freeze not usable 
– Magento Plugi...
PhpStorm / IntelliJ 
● IntelliJ / PhpStorm doc and code examples 
– Decompile and try on your own :) 
● API, stopHere :) 
...
IntelliJ IDEA 
Java, Lexer, Pattern, PsiElement, ...
PhpStorm / IntelliJ IDEA 
● No PHP interpreter all magic in Java 
● Closed Source for Plugins (PHP, Twig, Yaml, ...) 
● Op...
PsiViewer / PHP Language - Lexer
PsiViewer / PHP Language
PsiViewer / Twig + Pattern
Twig Lexer in PHP? 
SymfonyCon Warsaw 2013 - Matthias Noback - Diving Deep Into Twig 
http://www.youtube.com/watch?v=jDM0u...
Translations: Array To Java 
PHP 
Java
Plugin Overview
Symfony2 Plugin 
without Plugin
Symfony2 Plugin 
fr.adrienbrault.idea.symfony2plugin
0 
2013-04 
2013-05 
2013-06 
2013-07 
2013-08 
2013-09 
2013-10 
2013-11 
2013-12 
2014-01 
2014-02 
2014-03 
2014-04 
20...
PHP Annotation 
Index
PHP Annotation 
Entity completion and navigation together with Symfony2 Plugin
PHP Annotation 
Reference between “use” and docblock tag 
Code > Optimize Imports
Drupal Symfony2 Bridge 
Routing, Service Container (Yaml), Twig 
modules/<module>/<module>.services.info.yml
Drupal Symfony2 Bridge 
modules/<module>/<module>.info.yml
Laravel 
- Better Blade (Template) support of PhpStorm8: Linemaker, include, overwrites, … 
- (Symfony2) Translations 
- (...
Laravel
Shopware 
- Subscriber (Enlight): events, hooks and proxy classes 
- Template: Smarty 
- Doctrine for database
Shopware
Shopware 
… Doctrine ORM QueryBuilder support :) 
ShopwareModelsArticleRepository::getArticleQueryBuilder
Android Studio Prettify 
Google Android team is switching to IntelliJ IDEA (Android Studio) 
Google I/O 2013 - What's New ...
Android Studio Prettify 
Generator: XML Layout to Java
Android Studio Prettify 
Generator: XML Layout to Java
Android Studio Prettify 
Inspection: Cast check of view declaration 
Linemarker: View as icon
Productivity 
double your productivity (per month)? 
1 User * 6 hours per day * 20 days = 120 hours 
20.000 Users ...
Extension Points
Extension 
<Plugin>/META_INF/plugin.xml 
http://confluence.jetbrains.com/display/IntelliJIDEA/Custom+Language+Support
Extension: 
completion.contributor 
On demand: ctrl+space or in our custom auto popup (completion.confidence) 
Lookup stri...
Extension 
gotoDeclarationHandler 
On demand: ctrl+mousover
Extension 
psi.referenceContributor 
● Can provide completion (deprecated) and navigation 
● Live event: On file change, i...
Extension - fileBasedIndex 
● Primary extension of IntelliJ IDEA (“Invalidate Caches / Restart”) 
● Application storage (n...
Extension - fileBasedIndex 
Path: %HOMEPATH%/WebIde80/system/index 
On Symfony2 Plugin 
Replacement for appDevDebugProject...
Extension 
PhpTypeProvider2 
● Adds types (Classes, Interface) to methods, variables, … (the yellow ones) 
● Signature mod...
Extension 
PhpTypeProvider2 
Signature 
#Ő#M#P#CespendDoctrineModelBundleControllerDefaultController.container.getƀtwig 
X...
Extension 
annotator / inspections
Extension 
lang.foldingBuilder 
Reformat string values for better readability 
Example in Java: Anonymous class
Extension 
lineMarkerProvider
Symfony2 Plugin
Service Container 
Data from appDevDebugProjectContainer.xml, also from FileIndex
Service Container
Service Container
Form 
FormTypes, Extension (setDefaultOptions)
Form 
Doctrine / Class support
Form 
Translations: FileIndex or app/cache/dev/translations/catalogue.*.php
Doctrine
Doctrine 
Find* parameter and QueryBuilder with mapping on Annotation or Yaml
Twig
Twig
Twig
Twig 
Forms
Twig 
Assets
Twig
Twig 
Type docblock 
Deprecated: performance
„Template Create“ Quickfix 
with „extends“ and „block“ context search
Service Builder
Translation Extractor
Profiler 
app/cache/dev/profiler/index.csv 
3f318b,127.0.0.1,GET,http://127.0.0.1:8000/hello/test,1414590230, 
Serialized ...
Symbol Search / Search Everywhere 
Navigate -> Symfony2 Symbol...
Server Storage? 
Vagrant, VMs, Sync, Remote for „app/cache“ Folder. 
Other Frameworks: Zend, Typo3 / Flow, “external” Doct...
Server Storage
Server Storage
Dev Environment / Tools
Dev Environment / Tools 
Java Decompiler: JD-GUI - http://jd.benow.ca/ 
JetBrainsPhpStorm 8.0.1pluginsphplibphp.jar 
JetBr...
Dev Environment / Tools 
Add external plugin as library
Dev Environment / Tools 
Decompile PHP plugin and add sourcepath, to get source code support for 
externals
Dev Environment / Tools 
● idea-php-symfony2-plugin-test 
● github: idea-* 
● Wissenwertes über die IntelliJ IDEA / PhpSto...
Questions?
Upcoming SlideShare
Loading in …5
×

PhpStorm: Symfony2 Plugin

Some infomation about PhpStorm and IntelliJ development on the plugins: Symfony2 Plugin, Annotation, Shopware, Laravel and Drupal. Also some extension points analysis of IntelliJ and PhpStorm
-------------
SymfonyLive Berlin 2014

PhpStorm: Symfony2 Plugin

  1. 1. @Annotation Daniel Espendiller espend.de - daniel@espendiller.net
  2. 2. Symfony2 Plugin 2013-03 - Downloads: ~900.000 - daily usage: 20.000 – 40.000 PHP Annotations 2013-09 - daily usage: ~15.000 Laravel Plugin 2014-08 - daily usage: 1.000-2.000 Shopware Plugin 2014-02 - daily usage: ~1.000 Drupal Symfony2 Bridge 2014-06 - daily usage: ~500 Android Studio Prettify Not working for them :) Daniel Espendiller espend.de - daniel@espendiller.net
  3. 3. ● About PhpStorm / IntelliJ ● IntelliJ: Java Lexer / Pattern ● IntelliJ: Extension Points ● PhpStorm Plugin Overview ● Symfony2 Plugin (all Features :)) ● Dev Enviroment, Tools, Resources ● Questions Roadmap
  4. 4. PhpStorm / IntelliJ ● PhpStorm based on IntelliJ IDEA (Java) – With plugins: PHP, Twig, Yaml, … ● „PhpStorm 1.0 & WebStorm 1.0 are public, it is official!“ – May 27, 2010 ● PhpStorm 5: Symfony2 Framework Integration :( – September 12, 2012 – Closed source, so no public API ● PhpStorm6: PHP OpenApi – March 12, 2013
  5. 5. PhpStorm / IntelliJ ● PhpTypeProvider2 (ContainerInterface::get) – PhpTypeProvider(1) freeze not usable – Magento Plugin, Adrien Brault and PhpStorm Core Developer – Help on debug – What do we need and how do we use it? – More user feedback from real life projects; only on Symfony2 Plugin – Time issue for release date ● Twig as separate plugin (before: inside PHP) ● PhpStorm 7.0 – Improved PhpDoc support (Annotations) ● PhpStorm 7.1: – Dev in sync with IntelliJ IDEA
  6. 6. PhpStorm / IntelliJ ● IntelliJ / PhpStorm doc and code examples – Decompile and try on your own :) ● API, stopHere :) ● Single person project(s) ● My project(s) time window: ~4 hours per week ● Better JetBrains support, because of your downloads – Faster API updates – Pls update to PhpStrom8; only 35%
  7. 7. IntelliJ IDEA Java, Lexer, Pattern, PsiElement, ...
  8. 8. PhpStorm / IntelliJ IDEA ● No PHP interpreter all magic in Java ● Closed Source for Plugins (PHP, Twig, Yaml, ...) ● Open-Source IntelliJ Community Edition ● Display document structure (Lexer output) with Plugin: PsiViewer ● Code wrapped into PsiElements, which are targets for all extensions ● Just references [MethodReference → resolve() → Method()] PsiViewer: https://plugins.jetbrains.com/plugin/227
  9. 9. PsiViewer / PHP Language - Lexer
  10. 10. PsiViewer / PHP Language
  11. 11. PsiViewer / Twig + Pattern
  12. 12. Twig Lexer in PHP? SymfonyCon Warsaw 2013 - Matthias Noback - Diving Deep Into Twig http://www.youtube.com/watch?v=jDM0u0B_tXo
  13. 13. Translations: Array To Java PHP Java
  14. 14. Plugin Overview
  15. 15. Symfony2 Plugin without Plugin
  16. 16. Symfony2 Plugin fr.adrienbrault.idea.symfony2plugin
  17. 17. 0 2013-04 2013-05 2013-06 2013-07 2013-08 2013-09 2013-10 2013-11 2013-12 2014-01 2014-02 2014-03 2014-04 2014-05 2014-06 2014-07 2014-08 2014-09 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000 Symonfy2 - PhpStorm Plugin Downloads Per Month Symfony2 Plugin
  18. 18. PHP Annotation Index
  19. 19. PHP Annotation Entity completion and navigation together with Symfony2 Plugin
  20. 20. PHP Annotation Reference between “use” and docblock tag Code > Optimize Imports
  21. 21. Drupal Symfony2 Bridge Routing, Service Container (Yaml), Twig modules/<module>/<module>.services.info.yml
  22. 22. Drupal Symfony2 Bridge modules/<module>/<module>.info.yml
  23. 23. Laravel - Better Blade (Template) support of PhpStorm8: Linemaker, include, overwrites, … - (Symfony2) Translations - (Symfony2) Config - ...
  24. 24. Laravel
  25. 25. Shopware - Subscriber (Enlight): events, hooks and proxy classes - Template: Smarty - Doctrine for database
  26. 26. Shopware
  27. 27. Shopware … Doctrine ORM QueryBuilder support :) ShopwareModelsArticleRepository::getArticleQueryBuilder
  28. 28. Android Studio Prettify Google Android team is switching to IntelliJ IDEA (Android Studio) Google I/O 2013 - What's New in Android Developer Tools Google I/O 2014 - What's new in Android development tools
  29. 29. Android Studio Prettify Generator: XML Layout to Java
  30. 30. Android Studio Prettify Generator: XML Layout to Java
  31. 31. Android Studio Prettify Inspection: Cast check of view declaration Linemarker: View as icon
  32. 32. Productivity double your productivity (per month)? 1 User * 6 hours per day * 20 days = 120 hours 20.000 Users ...
  33. 33. Extension Points
  34. 34. Extension <Plugin>/META_INF/plugin.xml http://confluence.jetbrains.com/display/IntelliJIDEA/Custom+Language+Support
  35. 35. Extension: completion.contributor On demand: ctrl+space or in our custom auto popup (completion.confidence) Lookup string Type text Tip: Press „Tab“ for element selection; matches underlying string Twig hack :) Tail text
  36. 36. Extension gotoDeclarationHandler On demand: ctrl+mousover
  37. 37. Extension psi.referenceContributor ● Can provide completion (deprecated) and navigation ● Live event: On file change, inspection, reference search ... ● „Php Annotation“: references between „use“ and „Annotation“ ● >30ms
  38. 38. Extension - fileBasedIndex ● Primary extension of IntelliJ IDEA (“Invalidate Caches / Restart”) ● Application storage (not per Project!) for strings ● Storage structure: File -> Key -> Values[] ● File change listener ● Background job, switching to „block mode“ on mass changes (project initialize) ● Only lexer output <- Class index
  39. 39. Extension - fileBasedIndex Path: %HOMEPATH%/WebIde80/system/index On Symfony2 Plugin Replacement for appDevDebugProjectContainer.xml: - Services: Definition, Parameter, Tags - Twig usage for extends, include, macros, … - Translations - Routes - ...
  40. 40. Extension PhpTypeProvider2 ● Adds types (Classes, Interface) to methods, variables, … (the yellow ones) ● Signature modification: Append string parameter for higher application level
  41. 41. Extension PhpTypeProvider2 Signature #Ő#M#P#CespendDoctrineModelBundleControllerDefaultController.container.getƀtwig X - core X - our changes: special utf-8 char to split and get „twig“ parameter
  42. 42. Extension annotator / inspections
  43. 43. Extension lang.foldingBuilder Reformat string values for better readability Example in Java: Anonymous class
  44. 44. Extension lineMarkerProvider
  45. 45. Symfony2 Plugin
  46. 46. Service Container Data from appDevDebugProjectContainer.xml, also from FileIndex
  47. 47. Service Container
  48. 48. Service Container
  49. 49. Form FormTypes, Extension (setDefaultOptions)
  50. 50. Form Doctrine / Class support
  51. 51. Form Translations: FileIndex or app/cache/dev/translations/catalogue.*.php
  52. 52. Doctrine
  53. 53. Doctrine Find* parameter and QueryBuilder with mapping on Annotation or Yaml
  54. 54. Twig
  55. 55. Twig
  56. 56. Twig
  57. 57. Twig Forms
  58. 58. Twig Assets
  59. 59. Twig
  60. 60. Twig Type docblock Deprecated: performance
  61. 61. „Template Create“ Quickfix with „extends“ and „block“ context search
  62. 62. Service Builder
  63. 63. Translation Extractor
  64. 64. Profiler app/cache/dev/profiler/index.csv 3f318b,127.0.0.1,GET,http://127.0.0.1:8000/hello/test,1414590230, Serialized DataCollector -> Regular Expressions :)
  65. 65. Symbol Search / Search Everywhere Navigate -> Symfony2 Symbol...
  66. 66. Server Storage? Vagrant, VMs, Sync, Remote for „app/cache“ Folder. Other Frameworks: Zend, Typo3 / Flow, “external” Doctrine, Silex, ... JSON HTTP http://*:22221 http://127.0.0.1:22221/project http://127.0.0.1:22221/project/idea-espend http://127.0.0.1:22221/project/idea-espend/clear PHP Example: https://github.com/Haehnchen/ide-tools
  67. 67. Server Storage
  68. 68. Server Storage
  69. 69. Dev Environment / Tools
  70. 70. Dev Environment / Tools Java Decompiler: JD-GUI - http://jd.benow.ca/ JetBrainsPhpStorm 8.0.1pluginsphplibphp.jar JetBrainsPhpStorm 8.0.1pluginsphplibphp-openapi.jar JetBrainsPhpStorm 8.0.1pluginstwiglibtwig.jar
  71. 71. Dev Environment / Tools Add external plugin as library
  72. 72. Dev Environment / Tools Decompile PHP plugin and add sourcepath, to get source code support for externals
  73. 73. Dev Environment / Tools ● idea-php-symfony2-plugin-test ● github: idea-* ● Wissenwertes über die IntelliJ IDEA / PhpStorm Plugin Entwicklung ● JetBrains: JetBrains: Custom Language Support ● Doc: symfony2-plugin.espend.de ● JetBrains: Symfony Development using PhpStorm ● JetBrains: Drupal Development using PhpStorm
  74. 74. Questions?

×