public function __construct(array $targets, Factory $factory) { $this->factory = $factory; foreach ($targets as $item) { $this->indexed[$item] = false; } $this->items = $targets; }