CodeIgniter type hinting

I'd like to enable type hinting in my CodeIgniter application, but I'm having trouble getting it to work.  Here's the situation:

I'm writing code in the controller, and I'm calling library functions from within it.  Let's say my_library is a class with a couple of public functions, get and put.  I instantiate the library using CodeIgniter's framework:


I then have $this->my_library available in the code, but if I add the trailing ->, I don't see any suggestions.

$this->my_library->[ctrl-space] should show get and put, but instead I get "No suggestions."  I've tried the /** @var my_library $this->my_library */ method of type hinting, but it has no effect.  

Is there a good way to do type hinting in this situation?

Comment actions Permalink

@property $my_library my_library
on the class level or
/** @var my_library */
to var $my_library declaration (if any).


Comment actions Permalink

Rad.  I'll check out that link and see if I can make headway.


Please sign in to leave a comment.