Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netbeans, Symfony and hinting driving me mad

I'm a user of NetBeans, because it used to be the best bang for no bucks. The code completion was always good, even with something as huge and extensive as Symfony 2. However, I got a new mac, wanted to download Netbeans, installed it, etc.

The completion was always so good that I could do this for example:

<?php
// assuming a controller scope here.
public function anyAction()
{
    $em = $this->getDoctrine()->getEntityManager();
    $em-> /* and here there would have been a whole lot of possible hints, methods from    
    the EntityManager object on my old NetBeans install, and now it says: no hints */
?>

But they are not coming anymore. The hinting level is not deep enough. For example when using the 'new' keyword it will give hints on namespaces and classes I probably would use but that's it, nothing deeper then that.

I tried a whole lot with the settings and nothing really worked. Also: installing the Symfony plugin did not seem to work for this.

What should I do?

I really need those hints, since Symfony contains millions of functions and always searching the API is too time-consuming.

like image 783
Quant Avatar asked Apr 15 '12 20:04

Quant


1 Answers

This comes from a modification appeared in vendor/symfony/src/Symfony/Bundle/Doctrine/Bundle/Registry.php. The phpDoc for getEntityManager() method has been changed to :

/**
 * Gets a named entity manager.
 *
 * @param string $name The entity manager name (null for the default one)
 *
 * @return EntityManager
 */
public function getEntityManager($name = null)
{
    // ...
}

The working phpDoc for NetBeans is :

/**
 * Gets a named entity manager.
 *
 * @param string $name The entity manager name (null for the default one)
 *
 * @return \Doctrine\ORM\EntityManager
 */
public function getEntityManager($name = null)
{
    // ...
}

This has been fixed on github repository with commit 353085857ba6d17694e5322e2eefb0d8fec6380d on symfony/symfony repository.

like image 87
AlterPHP Avatar answered Oct 23 '22 11:10

AlterPHP