autocomplete - code hinting / completion for array of Objects in Zend Studio (or any other Eclipse based IDE) -
is possible? example, have array of dogs. how code completion work? here's code illustrate problem. advice great!
class dog { private $name; public static function init_many(array $names) { foreach ($names $n) { $collection[] = new self($n); } return $collection; } public function __construct($n) { $this->name = $n; } public function bark() { return sprintf('woof! name %s', $this->name ); } } $scoobi = new dog('scoobi'); $scoobi-> // code hinting / completion works! $dogs = dog::init_many(array('scoobi', 'lassie', 'bingo')); $dogs[0]-> // code hinting / completion doesn't work!
an indirect way be
$dogs = dog::init_many(array('scoobi', 'lassie', 'bingo')); foreach ($dogs & $dog) { /* @var $dog dog */ $dog-> //code hinting works here, //i use time itereting on doctrine collections }
Comments
Post a Comment