/**
* @var mixed[]
*/
protected $items = [];
/**
* @property SomeClass[] $items
*/
class SomeCollection extends IterableCollection
// ...
public function doSomeWork()
{
/** @var SomeClass[] $items */
$items = $this->items;
$items[0]->someMethod();
}
/**
* @return SomeClass[]
*/
protected function getItems ()
{
return $this->items;
}
public function doSomeWork()
{
$this->getItems()[0]->someMethod();
}