NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Better support for code insight in classes


Joined: 02 Feb 2006
Posts: 1
Location: Holland
Reply with quote
I've come across three situations where code insight lets me down (which are supported by other packages):

If I have instatiated a class, passing another object as a property, I cannot reach the methods of that object: e.g.: $this->ObjDateHelp->MakeADay() Code insight doesn't find the method MakeADay and pressing CNTRL-SPACE generates a message that property $this-ObjDateHelp was not found. The instant error check nor the debugger see this as an error however.

Defining a string in which I want to use a method, the method is not in the code insightlist. eg: $row[$counter]="<TR><TD>$this->MakeAMessage($today)</TD></TR>" If you press CNTRL SPACE typing the first part of the method, you will only see variabels in the list and no methods.

It would be an advantage if certain options would be supported, as extract($my_array, EXTR_OVERWRITE), I always forget how the exact text of the options are and was used to an editor that generated an optionslist.

So I would put these issues on the wish list.

For the rest: great IDE
View user's profileFind all posts by MarkTimmerSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
pressing CNTRL-SPACE generates a message that property $this-ObjDateHelp was not found


Code Insight finds all the properties of a class if they are defined appropriately. For example:
Code:
<?
  class aclass {
    public $ObjDateHelp;
    ...
  }
?>
or php'4 way:
Code:
<?
  class aclass {
    var $ObjDateHelp;
    ...
  }
?>


Probably code insight was unable to find instance of what _class_ you used to assign to it Smile
Indeed, it's not always possible to recognize what you assign to a variable or property. If it is an instance of a class or a string or an integer value etc, even guru-assisted looking at the php script does not always gives right results, what to say about an IDE? It's all caused by php language typeless nature.
To improve the situation, you may want to add TYPE HINTs in your code. Read FAQ topic dedicated to this problem http://forum.nusphere.com/tip-type-hints-t1563.html
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 24 Jan 2006
Posts: 311
Reply with quote
ddmitrie has a good point - look at the screenshot below

works fine in this example, because the code insight is given enough info to figure out the true type of the child. BUt it is not always the case of course
View user's profileFind all posts by yfaktorSend private message
Better support for code insight in classes
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