NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Need some clarifications on code insight and phpdoc comments
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
Say I have a couple of files:

File A:
Code:

require_once('FooObj.php');

$foo = new FooObj();
$_SESSION['foo'] = $foo;


File B:
Code:

$_SESSION['foo']->DoSomeFoo();


How do I get code insight to work in File B for the foo object contained in the session? I've tried a few things with phpdoc comments, but not hit the right thing. (When I try to use completion, PhpED simply does nothing - no errors.) And in general, what's the best way to use phpdoc in this sort of situation - from a proper documentation perspective? @global and @var neither appear quite right, at least based on the phpdoc docs.

Thanks![/code]
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website
Re: Need some clarifications on code insight and phpdoc comm


Joined: 14 Jun 2007
Posts: 67
Reply with quote
bobwilliams wrote:

File B:
Code:

$_SESSION['foo']->DoSomeFoo();


I'm not 100% sure how to do it with Session vars, but could try:

Code:
/** @var $_SESSION['foo'] FooObj */

@var seems to work properly for other variables.
View user's profileFind all posts by CjungeSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
as of PhpED version 5.0, code completion is not supported for the object instances stored in arrays, yet.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 22 Feb 2006
Posts: 106
Reply with quote
You're right, Dmitri, I've noticed PhpEd 5.0 does not support it ... at least for now Wink

I've added it in the feature requests. I think it should be in the top priorities as it can improve a lot the code insight functionality for a lot of users.


Good luck !!
View user's profileFind all posts by medifirstSend private message
Need some clarifications on code insight and phpdoc comments
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