Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » PhpDoc @property typed arrays not recognized ?
PhpDoc @property typed arrays not recognized ? [message #1011759] Wed, 20 February 2013 02:58
Daniel Jann is currently offline Daniel Jann
Messages: 1
Registered: February 2013
Junior Member
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 ?
Previous Topic:Performance Issue - Very slow editor response
Next Topic:How to add PHP servers and debug configurations from outside?
Goto Forum:
  


Current Time: Wed Apr 16 09:37:37 EDT 2014

Powered by FUDForum. Page generated in 0.02141 seconds