NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code Folding for Arrays


Joined: 19 Oct 2004
Posts: 14
Reply with quote
Hello.

"Code Folding" is a great feature and helps me much. But I a method that returs a array with objects, the "Code Folding" is lost.
It would helped me, if there is a way to declare a array of objects. For example:

Code:
@return array[0..n][MyClass]
or
Code:
@return array[][MyClass]
View user's profileFind all posts by m.stiffelSend private message
Re: Code Folding for Arrays
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
m.stiffel wrote:
It would helped me, if there is a way to declare a array of objects. For example:

Code:
@return array[0..n][MyClass]
or
Code:
@return array[][MyClass]


I assume you meant to type code insight, not code folding.

This indeed would be extremely helpful, but as with this feature request, the limitation is not with PhpED but with the syntax of phpDoc. I suggest following the advice given in the other thread (discuss it with phpDoc's author) to try to make something happen here.
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website


Joined: 19 Oct 2004
Posts: 14
Reply with quote
Hello.

Yes, I mean code insight. I will try to contact the author of phpDoc.
But I thought PhpEd uses it's own phpDoc-Parser. So it is possible to define custom-tags only for the IDE.
View user's profileFind all posts by m.stiffelSend private message


Joined: 29 Oct 2008
Posts: 4
Reply with quote
Hello.

I find it useful either. I'd like to have an option to use code insight for array of objects, so that when i call a method which returns that type of value, then it is available in "foreach" iterations. Example:

Code:

class MyClass
{

/**
 * @var string $char
 */
private $char;

/**
 * @param string $char
 */
public function __construct($char){
  $this->char = $char;
}

/**
 * @return string $this->char
 */
public function getChar(){
  return $this->char;
}

/**
 * @return MyClass[] $list array of MyClass objects
 */
public static function getAll(){

  $list = array();
  $list[] = new MyClass('A');
  $list[] = new MyClass('B');

  return $list;
}
}

$list = MyClass::getAll();

// echo $list[0]->get [Here code insight gives me getChar() method for auto complete]

foreach($list as $obj){
  // echo $obj->get [Here code insight gives me getChar() method for auto complete]
}


View user's profileFind all posts by dumkaSend private message
Code Folding for Arrays
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic