Working through a Symfony2 project at the moment and have noticed the
lack of auto completion on instance variables (im using the latest
version of Netbeans). e.g. in a typical controller:

$this->container->ge ... // no auto completion

In Netbeans at least, it is because the instance variables don't have
an @var comment. e.g. the above case is solved by changing
ContainerAware to have:

/** @var ContainerInterface */
protected $container;

Looking further, the large majority, if not all of the symfony code
omits an @var comment. Is there a particular reason for this? I'd be
happy to start putting them in for sections of the codebase; it speeds
learning up a lot and in general makes things a lot easier to work
with. I wanted to check first if there was a reason they were left out
(the Doctrine and Zend codebases seem to have them consistently
throughout). And what would be the preferred format for symfony?
Doctrine and Zend use a spaced out format:

/**
 * The used Configuration.
 *
 * @var Doctrine\ORM\Configuration
 */
private $config;

/**
 * The database connection used by the EntityManager.
 *
 * @var Doctrine\DBAL\Connection
 */
private $conn;


Or you can use a compact format:

/** @var Doctrine\ORM\Configuration */
protected $config;
/** @var Doctrine\DBAL\Connection */
protected $conn;

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to