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 226725

Summary: Autocomplete methods for dependency injection container in symfony 2 and zendframewok 2
Product: php Reporter: dextervip
Component: SymfonyAssignee: Tomas Mysik <tmysik>
Status: NEW ---    
Severity: normal CC: fazae, obrejla, thiagokrug
Priority: P3    
Version: 7.3.1   
Hardware: PC   
OS: Other   
Issue Type: ENHANCEMENT Exception Reporter:

Description dextervip 2013-02-26 16:59:55 UTC
Hi,

It would be super feature if netbeans could detects objects type from dependency injection container(http://symfony.com/doc/2.0/book/service_container.html) and auto-complete with their methods.

For example, $this->container->get('doctrine') returns a Doctrine\Bundle\DoctrineBundle\Registry instance. In the container, the key doctrine corresponds to Doctrine\Bundle\DoctrineBundle\Registry.

Then netbeans could read container from console ´´php app/console container:debug´´ to discover which keys corresponds to which classes.


This would be an awesome feature, I am sure, A lot of developer will love it! It could be done as well for zendframework 2. I believe there are a lot of developers  that would like it.
Comment 1 Tomas Mysik 2013-02-27 11:42:14 UTC
Thanks for the report, we will try to look at it.
Comment 2 ndm 2014-01-25 19:49:52 UTC
The easiest way to parse the file app/cache/dev/appDevDebugProjectContainer.xml

This file provide all services informations, parameters, constructors :

 - name 
 - return type
 - scope
 - tags
 - call

The tag is services, with sub tag service for each of them.
Comment 3 fazae 2014-10-05 10:14:48 UTC
if it is too difficult, maybe we could use annotation. 

Today, it is working for class variable, but not for variable in methods.

Something like :
 // @var Doctrine\Bundle\DoctrineBundle\Registry
 $em=$this->container->get('doctrine');
Comment 4 fazae 2014-10-05 10:25:37 UTC
Autocomplete works witrh netbeans if you use this syntax :

 /* @var $em \Doctrine\Bundle\DoctrineBundle\Registry */
 $em=$this->container->get('doctrine');
 $em->...