Hey Daniel

The @var are purposely left off of protected and private methods to
declutter the code. If there are getters for those properties, those should
have proper @return tags. This effectively documents the public API only.
One way or another, that's *why* you see what you do.

Now, at the very least, I see from your example that classes that are
commonly subclassed - like ContainerAware - should probably have the @var.
I'd recommend making a pull request with that change and state your case - I
think you have a point.

Thanks!

@weaverryan
On Jan 24, 2011 7:29 PM, "danielholmesau" <[email protected]> wrote:
> 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]<symfony-devs%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/symfony-devs?hl=en

-- 
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