src/ParametricTree/RecursiveLeaf.php
public function setDepth($depth)
    {
        if (! is_null($this->depth)) {
            throw new RuntimeException('The depth was already set.');
        }
        if (! is_int($depth)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid type of specified depth; must be an integer, '
                . '"%s" received.',
                gettype($depth)
            ));
        }
        $this->depth = $depth;
    }
public function setDepth($depth)
    {
        if (! is_null($this->depth)) {
            throw new RuntimeException('The depth was already set.');
        }
        if (! is_int($depth)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid type of specified depth; must be an integer, '
                . '"%s" received.',
                gettype($depth)
            ));
        }
        $this->depth = $depth;
    }
public function setDepth ( $ depth ) { if ( ! is_null ( $ this -> depth ) ) { throw new RuntimeException ( 'The depth was already set.' ) ; } if ( ! is_int ( $ depth ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid type of specified depth; must be an integer, ' . '"%s" received.' , gettype ( $ depth ) ) ) ; } $ this -> depth = $ depth ; }
Sets the depth of leaf in the tree.

@param int $depth The depth of leaf in the tree

@throws \RuntimeException         If the depth was already set
@throws \InvalidArgumentException If type of specified depth is invalid
Sets the depth of leaf in the tree .