This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 228797

Summary: Better Symfony2 integration: Service - & Service Container Methods - Autocompletion
Product: php Reporter: devnull333
Component: SymfonyAssignee: Ondrej Brejla <obrejla>
Status: NEW ---    
Severity: normal CC: tmysik
Priority: P2    
Version: 7.3.1   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Symfony2 console container:debug output
Php Storm Symfony2 Plugin animated Screenshot

Description devnull333 2013-04-20 15:21:54 UTC
Created attachment 133620 [details]
Symfony2 console container:debug output

animated example image of the working phpstorm plugin:

http://plugins.jetbrains.com/files/7219/screenshot_14166.png


In Symfony2 you need the Service Container quite often, you call it in the controller like this:

	$this->get('

then you have to enter the name of the service. in the standard distribution symfony2 has about 200 different services -> names which can come after the ´´´$this->get('´´´ 
netbeans could easily add an autocompletion by calling ```php app/console --no-ansi container:debug``` which dumps all the possible services (see attachment for example output).

after adding the service name, you have to add the method name you want to call from the before named service

	$this->get('form.factory')->addType()

if you really to use symfony this two autocomplets are mandatory.

for the second autocomplete there exists another bug: #226725

it would be good having the same feature set as the phpstorm & eclipse plugin:

http://symfony.dubture.com/
eclipse:
    Codeassist for Symfony specific elements, like services, routes, template paths, entities, translations and twig blocks.
    Navigation: Hyperlinking of routes, templates, twig blocks/functions/filters and services
    Annotation support
    Twig support

http://plugins.jetbrains.com/plugin?pr=phpStorm&pluginId=7219
phpstorm:
    Autocomplete service id in ContainerInterface::get() calls
    Clickable service id in ContainerInterface::get() first argument
    Detect ContainerInterface::get() result type and thus provide autocomplete
    Autocomplete template name in render() calls
    Clickable template name in render() calls
    Autocomplete template name in twig templates
    Clickable template name in twig templates
    Autocomplete route name in UrlGenerator::generate() calls
    Autocomplete route name in twig templates

routes would work the same way: 

	php app/console --no-ansi router:debug

example output:

	[router] Current routes
	Name                     Method Host Pattern
	_assetic_f714d3f         ANY    ANY  /css/frontend/main.css
	_wdt                     ANY    ANY  /_wdt/{token}
	_profiler_home           ANY    ANY  /_profiler/
	_profiler_search         ANY    ANY  /_profiler/search
	_profiler_search_bar     ANY    ANY  /_profiler/search_bar
	_profiler_purge          ANY    ANY  /_profiler/purge
	_profiler_info           ANY    ANY  /_profiler/info/{about}
	_profiler_import         ANY    ANY  /_profiler/import
	_profiler_export         ANY    ANY  /_profiler/export/{token}.txt
	_profiler_phpinfo        ANY    ANY  /_profiler/phpinfo
	_profiler_search_results ANY    ANY  /_profiler/{token}/search/results
	_profiler                ANY    ANY  /_profiler/{token}
	_profiler_router         ANY    ANY  /_profiler/{token}/router
	_profiler_exception      ANY    ANY  /_profiler/{token}/exception
	_profiler_exception_css  ANY    ANY  /_profiler/{token}/exception.css
	_configurator_home       ANY    ANY  /_configurator/
	_configurator_step       ANY    ANY  /_configurator/step/{index}
	_configurator_final      ANY    ANY  /_configurator/final
	my_frontend_static       ANY    ANY  /{name}
Comment 1 devnull333 2013-04-20 15:25:07 UTC
Created attachment 133621 [details]
Php Storm Symfony2 Plugin animated Screenshot
Comment 2 Tomas Mysik 2013-04-22 08:47:32 UTC
This depends more one the editor part, reassigning. Thanks.