4

ArrayObjectクラスの単純な拡張であるクラスがあります。

/**
 * what to put here? :)
 */
class Collection extends \ArrayObject
{
    /**
     * @param Item
     */
    public function add(Item $item)
    {
        $this->append($item);
    }
}

IDE で ArrayObject 拡張クラスの要素に対してコード補完を使用することはできますか?

foreach ($collection as $item)
{
    $item->getPrice(); //my IDE doesn't not know the object here
}
4

0 に答える 0