Completion and Variable Type Hinting
Not sure if I'm using phpdoc/variable hinting correctly, here is the scenario. (Using 95.57)
Method from BaseDataObject class:
/**
* @param $idArray
* @return BaseDataObject[]
*/
function bulkLoad($idArray) {....}
Usage of method from BaseDataObject (via UserObject - which is a descendant of it)
$u=new UserObj(); // UserObj extends BaseDataObject
$collection = $u->bulkLoad($idlist); //$idlist is an array of ints
$collection-> // completion here shows methods for the BaseDataObject class
$collection[1]-> // completion here shows nothing and I'd expect it to show methods for BaseDataObject
I'm probably just doing something wrong...any help is much appreciated!
Thanks
-Doug
Please sign in to leave a comment.
$collection-> // completion here shows methods for the BaseDataObject class
Seems like bug, possible the same bug as http://youtrack.jetbrains.net/issue/WI-1700
$collection[1]-> // completion here shows nothing and I'd expect it to show methods for BaseDataObject
Not yet implemented. Please vote for: http://youtrack.jetbrains.net/issue/WI-1029
@Dmitry you are wrong in both cases - reports you referred this have nothing in common with original poster problem.
Both cases (improper completion on array and the absence of completion on array element) are now fixed and covered by tests. Will be available in next EAP.
To get better understanding on what's going on (wrong) check inferred types for variables via Ctrl-Q.
Great, thanks for the info.
-Doug