src/Tree/Node.php
public function display($level = 0)
    {
        $value = $this->getContent();

        if (null === $value) {
            $value = 'null';
        } elseif (is_object($value)) {
            $value = get_class($value);
        } elseif (is_array($value)) {
            $value = 'Array';
        }

        $ret = str_repeat(' ', $level * 4) . $value . "\n";

        $children = $this->getChildren();

        foreach ($children as $child) {
            $ret .= $child->display($level + 1);
        }

        return $ret;
    }
public function display($level = 0)
    {
        $value = $this->getContent();

        if (null === $value) {
            $value = 'null';
        } elseif (is_object($value)) {
            $value = get_class($value);
        } elseif (is_array($value)) {
            $value = 'Array';
        }

        $ret = str_repeat(' ', $level * 4) . $value . "\n";

        $children = $this->getChildren();

        foreach ($children as $child) {
            $ret .= $child->display($level + 1);
        }

        return $ret;
    }
public function display ( $ level = 0 ) { $ value = $ this -> getContent ( ) ; if ( null === $ value ) { $ value = 'null' ; } elseif ( is_object ( $ value ) ) { $ value = get_class ( $ value ) ; } elseif ( is_array ( $ value ) ) { $ value = 'Array' ; } $ ret = str_repeat ( ' ' , $ level * 4 ) . $ value . "\n" ; $ children = $ this -> getChildren ( ) ; foreach ( $ children as $ child ) { $ ret .= $ child -> display ( $ level + 1 ) ; } return $ ret ; }
Displays all elements from a tree in hierarchic order

@param int $level Current level of indentation
Displays all elements from a tree in hierarchic order