public function add($item)
    {
        if (is_array($item)) {
            foreach ($item as $element) {
                $this->add($element);
            }
        } else if (! $this->contains($item->path())) {
            $this->items[$item->path()] = [
                'instance' => $item,
                'listener_index' => $item->addPathListener([$this, 'updatePath'])
            ];
        }
        return $this;
    }