/** * Dump the node data as string * @param NodeInterface $node * @return string */ public static function dump(NodeInterface $node) { $prefix = str_repeat(static::DUMP_PREFIX, $node->getLevel()); $left = $node->getLeftValue(); $right = $node->getRightValue(); $level = $node->getLevel(); $title = $node->getNodeTitle(); $dumpData = array(static::DUMP_PREFIX_POS => $prefix, static::DUMP_LEFT_POS => $left, static::DUMP_RIGHT_POS => $right, static::DUMP_LEVEL_POS => $level, static::DUMP_TITLE_POS => $title); ksort($dumpData); $dumpString = vsprintf(static::DUMP_FORMAT, $dumpData); return $dumpString; }