Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Specify type for class variables
Specify type for class variables [message #35385] Fri, 13 July 2007 19:34 Go to next message
Eclipse UserFriend
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 #35421 is a reply to message #35385] Fri, 13 July 2007 20:07 Go to previous messageGo to next message
Adam Randall is currently offline Adam RandallFriend
Messages: 19
Registered: July 2009
Junior Member
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.

--
Adam Randall adam@lockdownnetworks.com
Senior Software Engineer (866) 844-8080
Lockdown Networks, Inc.
Re: Specify type for class variables [message #35455 is a reply to message #35385] Fri, 13 July 2007 20:37 Go to previous messageGo to next message
B. Charbonneau is currently offline B. CharbonneauFriend
Messages: 2
Registered: July 2009
Junior Member
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.
Re: Specify type for class variables [message #35490 is a reply to message #35421] Fri, 13 July 2007 21:18 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
>
>
Previous Topic:Debugger - how to start
Next Topic:CSS parser problem
Goto Forum:
  


Current Time: Mon Jan 20 17:22:18 GMT 2025

Powered by FUDForum. Page generated in 0.03421 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top