[TYPO3-v4] Something for CGL?

Xavier Perseguers typo3 at perseguers.ch
Fri Nov 26 09:32:42 CET 2010


Hi,

> Modern IDEs have very smart code completion and code inspection routines
> which can help a lot with writing code without simple errors like typos
> in variable names, incorrect parameter order, etc.
>
> Many can use phpdoc comments to use code completion, etc. on objects
> which are created by calling makeInstance().
>
> Could we add a suggestion/rule to add phpdoc @var comments to calls of
> makeInstance()?
>
> Example:
> /** @var $install tx_em_Install */
> $install = t3lib_div::makeInstance('tx_em_Install');

I agree on the idea, what should be defined in such cases too:

$myObjects = array();
$myObjects[] = $someObject;
$myObjects[] = $someOtherObject;

// both objects are of type tx_foo

Now at some point you do this:

foreach ($myObjects as $myObject) {

}

What about having in the CGL that $myObject should get a phpDoc @var 
comment too?

Cheers
Xavier


More information about the TYPO3-project-v4 mailing list