/** * @param NodeTrait $node * * @return $this */ protected function assertNodeExists(self $node) { if (!$node->getLft() || !$node->getRgt()) { throw new LogicException('Node must exists.'); } return $this; }