public function apply() { if ($this->canApply()) { $subject = $this->getSubject(); $parent = $subject->getParent(); $node = $this->createNode($parent); $node->moveBefore($subject); $this->updateWorkspaceInfo(); } }