protected function flush()
    {
        $this->lastClassName = $this->className;

        if ($this->currentDependency !== null) {
            $this->getCollection()->addDependency(
                $this->id,
                $this->className,
                $this->constructor,
                $this->currentDependency);
        }

        $this->currentDependency = null;
    }