NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code completion for object instances in arrays
Veteran

Joined: 22 Feb 2006
Posts: 106
Reply with quote
Please, it would be a real breakthrough for code completion to be able to recognize object instances stored in array, such as session arrays !

In the meantime, do you have a tip / workaround ?

I sometimes add an extra variable (not very satisfying though as it worthlessly lengthes the code source) which refers to the object instance with a phpdoc-style comment above it, like this:

FILE A:
====
$object = new Object();
$_SESSION['A'] = $object;


FILE B:
====
/**
* @var Object
*/
$a = $_SESSION['A'];


Someone's got another idea ?
View user's profileFind all posts by medifirstSend private message


Joined: 02 Apr 2007
Posts: 7
Location: San Francisco, CA
Reply with quote
I'll revive this post to throw my support in. I run into this all the time using $GLOBALS['objectname'] from within a function. This happens most often when doing database stuff for me, since my database connections (and associated methods) are in a global object that I often need to access from otuside the global scope:
Code:
$GLOBALS['db']->insert(...);


I know it's easy enough to throw in a 'global $db' in each function, but that gets messy fast.
View user's profileFind all posts by tabaccoSend private message
Code completion for object instances in 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