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:

$this->load->library('my_library');


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?

2 comments
Comment actions Permalink

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

FYI
http://youtrack.jetbrains.net/issue/WI-1174
http://www.grafikkaos.co.uk/blog/article/104-getting-autocomplete-for-codeigniter-2.0-with-phpstorm

0
Comment actions Permalink

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

0

Please sign in to leave a comment.