NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code Complete not picking up sub class


Joined: 13 Nov 2009
Posts: 1
Reply with quote
I have a real simple setup. Relevant code below:

Code:
class Controller
{
    /** @var Session */
    protected $session;
}

class OtherController extends Controller
{
     $this->session->CODE_COMPLETE_TRIGGER
}

class Session_Core
{

}

class Session extends Session_Core
{
     public function subclass_method_here() {}
}



The problem is that where CODE_COMPLETE_TRIGGER is, I only get completion for the Session_Core class methods. I have also tried the code below in the controller and I get the same result of only having Session_Core methods being picked up.

Code:
        $test = new Session();
        $test->CODE_COMPLETE_TRIGGER


Any ideas what could be causing this? Oddly enough, all my other subclasses work fine.
View user's profileFind all posts by uprise78Send private message
Veteran

Joined: 22 May 2008
Posts: 141
Reply with quote
This works as intended for me, showing both session_core() and session() in the autocomplete at the beginning of both CODE_COMPLETE_TRIGGER locations:
Code:
<?php
class Session_Core {
   function session_core() { }
}

class Session extends Session_Core {
   public function session() {}
}

class Controller {
   /** @var Session */
   protected $session;
}

class OtherController extends Controller {
   function foo() {
      $this->session->CODE_COMPLETE_TRIGGER // Works as intended.
   }
}

$session = new Session();
$session->CODE_COMPLETE_TRIGGER // Works as intended.
View user's profileFind all posts by simshaunSend private message
Code Complete not picking up sub class
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