``$this->node->hasAttribute('id')`` will always be false here as you are in the ``else`` part.