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;
    }