I saw in the PDT 3.1.1 release notes, section "Properly resolve type of elements in arrays based on "<typeName>[]" in PHPDoc blocks" that a function returning an array of custom classe's object may be specified using PhpDoc:
class Employee {
public function getName() {}
public function getSalary() {}
}
/**
* @return Employee[]
*/
function listOfEmployees() {
//...
}
$a = listOfEmployees();
$a[0]->
when typing last line, code completion will show getName() and getSalary() as expected. Great!!
But it doesn't seem to work with magic properties:
/**
* Employee
*
* @property string name
* @property string salary
* @property Employee[] coWorkers
*/
class Employee {
function __get($name) {
//...
}
}
/**
* @return Employee
*/
function getEmployee(/*...*/) {
//...
}
$a = getEmployee();
$a->coWorkers[0]->
Now code completion should show name, salary and coWorkers, but it doesn't.
Unless I missed something, this doesn't seem to be implemented. Is there any plan to implement it ?