[TYPO3-v4] Something for CGL?
Lieuwe Hummel
l.hummel at drecomm.nl
Fri Nov 26 16:17:42 CET 2010
On 26-11-2010 9:32, Xavier Perseguers wrote:
>> 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
I have played with this issue as well. I had the thought of using
something like this:
/** @var $myObjects tx_foo[] */
$myObjects = array();
$myObjects[] = $someObject;
$myObjects[] = $someOtherObject;
I'm not familiar with PHPDoc parsers, etc, so I can not say if this will
work for those.
Regards,
Lieuwe
More information about the TYPO3-project-v4
mailing list