Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0a1

Request #12199 specify return type for arrays
Submitted: 2007-10-08 12:54 UTC
From: cweiske Assigned: ashnazg
Status: Wont fix Package: PhpDocumentor (version 1.4.0)
PHP Version: 5.2.4 OS:
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 33 + 3 = ?

 
 [2007-10-08 12:54 UTC] cweiske (Christian Weiske)
Description: ------------ it would be helpful if @return would allow specifying the type of array values, e.g. @return array(MyClass) Array of MyClass objects

Comments

 [2008-04-11 16:22 UTC] ashnazg (Chuck Burgess)
An option mentioned on the Sourceforge forums [1] is to use the "generics" syntax: @return array<MyClass> array of MyClass objects [1] - https://sourceforge.net/forum/message.php?msg_id=4889244
 [2008-05-14 18:02 UTC] steplg (Stepan Kuntso)
I think it would be very helpfull to specify several ways to specify return value. I really need, for example, this ways: * Array(MyClass) * Array( SOME_CONSTANT => MyClass ) * Array( SOME_CONSTANT => Array(SOME_CONST1 => MyClass1 , SOME_CONSTANT2 => MyClass2 ) ) The last 2 ways are very usefull if you use assotiative arrays as a return values. If it's possible i could do this features by myself, but i don't really know how and where change source code. Please contact me (StepLg [@] GMail.com without []) about this question.
 [2011-11-02 17:44 UTC] dsas (Dean Sas)
There are a few different patterns in use in the wild. The PHPStorm IDE uses Foo[] where Foo is the type. PHPLint uses array[Bar]Foo where Bar is the array key type and Foo is the array value type.
 [2012-09-01 02:25 UTC] ashnazg (Chuck Burgess)
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: ashnazg -Roadmap Versions: 1.5.0a1 +Roadmap Versions:
No more feature work on phpDocumentor 1.x. Check out the new phpDocumentor 2.x (http://www.phpdoc.org/).