Specify type for class variables [message #35385] |
Fri, 13 July 2007 19:34 |
Eclipse User |
|
|
|
Originally posted by: andrescpaz-eclipse.yahoo.com
Hi,
How can specify the type of a class variable so it works with autocomplete. I'm trying this:
class Company {
/* @var $worker Human */
public $worker;
...
}
class Human {
...
public function test() {
}
}
$c = new Company();
$c->worker-> |THERE IS NO AUTOCOMPLETE HERE...|
Is it even possible? Thanks!
Andres.
|
|
|
|
|
Re: Specify type for class variables [message #35490 is a reply to message #35421] |
Fri, 13 July 2007 21:18 |
Eclipse User |
|
|
|
Originally posted by: andrescpaz-eclipse.yahoo.com
I was expecting that $c->worker-> would give me the list of methods/vars available to Human.
-a.
Adam Randall wrote:
> On Fri, 13 Jul 2007 12:34:42 -0700
> Andres Paz <andrescpaz-eclipse@yahoo.com> wrote:
>
>> Hi,
>>
>> How can specify the type of a class variable so it works with autocomplete. I'm trying this:
>>
>> class Company {
>>
>> /* @var $worker Human */
>> public $worker;
>> ...
>> }
>>
>> class Human {
>> ...
>> public function test() {
>>
>> }
>> }
>>
>>
>> $c = new Company();
>> $c->worker-> |THERE IS NO AUTOCOMPLETE HERE...|
>>
>>
>> Is it even possible? Thanks!
>>
>> Andres.
>>
>
> Pardon my ignorance, but what do you expect after the -> after $c->worker? Or are you saying $c-> isn't giving you anything?
>
> Adam.
>
|
|
|
Re: Specify type for class variables [message #35521 is a reply to message #35455] |
Fri, 13 July 2007 21:19 |
Eclipse User |
|
|
|
Originally posted by: andrescpaz-eclipse.yahoo.com
Yes. That worked!
Just wondering, why is the syntax different wrt variables. Anyway, thanks!
-a.
Brent C wrote:
> Try:
> class Company {
> /**
> * @var Human
> */
> public $worker;
> ...
> }
>
> -Brent
>
> Andres Paz wrote:
>
>> Hi,
>> How can specify the type of a class variable so it works with
>> autocomplete.
> I'm trying this:
>> class Company {
>> /* @var $worker Human */
>> public $worker;
>> ...
>> }
>> class Human {
>> ...
>> public function test() {
>> }
>> }
>> $c = new Company();
>> $c->worker-> |THERE IS NO AUTOCOMPLETE HERE...|
>> Is it even possible? Thanks!
>> Andres.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03421 seconds