NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code Insight Question


Joined: 26 Jul 2006
Posts: 2
Reply with quote
Hello,

first i like to say, that PHPEd is a very nice tool. Thank you to the developers!

Now, i have a question about code insight in classes. Please look at the following code:

Code:

class ClassA
{
   public function foo() { }
}

class ClassB
{
   private $m_strSomeVar;
   private $m_objClassA

   function __construct(ClassA $objClassA)
   {
       $this->m_strSomeVar = "";
       $this->m_objClassA = $objClassA;
       $this->???                    // <-- no popop, phped dont show methods in ClassA
   }
}


If i use CTRL + Space, it shows a message "Failed to identify type of $this->m_objClassA".

Is there are a way to work code completion in this case?
View user's profileFind all posts by thunderbirdSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Your sample works like a charm in PhpED:





Just add the overlooked semicolon at the end of this line:
private $m_objClassA

BTW, Did you notice that PhpED underlined "function" in red? it's a clear indication that there is a syntax error in the code Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 26 Jul 2006
Posts: 2
Reply with quote
Thank you for your answer.

Sorry, a big error by me. Your example works.

I had to correct my code, the following code not work.

Code:


class ClassA
{
   public function foo() { }
}

class ClassB
{
   private $m_strSomeVar;
   private $m_objClassA;

   function __construct(ClassA $objClassA)
   {
       $this->m_strSomeVar = "";
       $this->m_objClassA = $objClassA;
       $this->m_objClassA->???                    // <-- no popop, phped dont show methods in ClassA
   }
}


Please look in __construct at $this->m_objClassA->???, before this posting i have wrote $this->???
View user's profileFind all posts by thunderbirdSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
thanks!
I replicated the problem and am passing to QA for further processing and fixing.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Code Insight Question
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