[Flow] [RFC] CGL: Allow "ArrayElementType[]" syntax

Bastian Waidelich bastian at typo3.org
Thu Feb 5 11:31:46 CET 2015


Hi all,

what do you think about allowing (= add to our CGL) the following syntax 
for "generic" arrays:

/**
  * @var User[]
  **/
protected $users;

We currently suggest

/**
  * @var array<User>
  **/
protected $users;

But that is not supported by common IDEs (yet) so you'll have to add 
s.th. like

/** @var User $user **/
foreach ($this->users as $user) {
}

in order to get code-completion, highlighting and (most importantly) 
refactoring support.

-- 
Bastian Waidelich


More information about the Flow mailing list