Three intellisense related questions

General discussion on Zend Studio
Post Reply
btrotter
Posts: 137
Joined: Sat Sep 05, 2009 9:11 pm

Three intellisense related questions

Post by btrotter » Sun Aug 07, 2011 7:59 pm

1) Given a class that implements __get with dynamic property names- eg you never know what names are valid, is there a way to say /* @ignorenext undeclared property */ or something to make it ignore the next warning or the next undeclared property warning

2) similar to 1, say you have $ses = new SomeSessionClass(); $ses->SomeValue, can I explicitly say /* @property string SomeValue */ just before the $ses declaration so it knows $ses has a SomeValue during its scope?

3) given $arr[0] is a FooClass, how can I make $arr[0]->SomeMethod() be aware that $arr[0] is a FooClass which has a SomeMethod() without /* @var $item FooClass */ $item = &$arr[0];

gdvlive
Posts: 6
Joined: Sun Jul 05, 2009 11:25 am

Re: Three intellisense related questions

Post by gdvlive » Sun Aug 07, 2011 8:38 pm

btrotter wrote:3) given $arr[0] is a FooClass, how can I make $arr[0]->SomeMethod() be aware that $arr[0] is a FooClass which has a SomeMethod() without /* @var $item FooClass */ $item = &$arr[0];
Well, you still have to add a PHPDoc statement, but you can save an additional variable:

Code: Select all

while ($whatever) {
    /* @var $arr FooClass */
    $arr[0]->/* Here you should get code completion for FooClass... */ 
Greetings
markus

PS: @board devs: Can you please add a monospace font for the bbcode-tag code=php? thanks! ;)

btrotter
Posts: 137
Joined: Sat Sep 05, 2009 9:11 pm

Re: Three intellisense related questions

Post by btrotter » Sun Aug 07, 2011 8:59 pm

gdvlive wrote:

Code: Select all

/* @var $arr FooClass */ 
thanks, that seems to work- any thoughts on the magic property stuff?

Post Reply