src/JsonDecoder.php
public function setMaxDepth($maxDepth)
    {
        if (!is_int($maxDepth)) {
            throw new \InvalidArgumentException(sprintf(
                'The maximum depth should be an integer. Got: %s',
                is_object($maxDepth) ? get_class($maxDepth) : gettype($maxDepth)
            ));
        }

        if ($maxDepth < 1) {
            throw new \InvalidArgumentException(sprintf(
                'The maximum depth should 1 or greater. Got: %s',
                $maxDepth
            ));
        }

        $this->maxDepth = $maxDepth;
    }
public function setMaxDepth($maxDepth)
    {
        if (!is_int($maxDepth)) {
            throw new \InvalidArgumentException(sprintf(
                'The maximum depth should be an integer. Got: %s',
                is_object($maxDepth) ? get_class($maxDepth) : gettype($maxDepth)
            ));
        }

        if ($maxDepth < 1) {
            throw new \InvalidArgumentException(sprintf(
                'The maximum depth should 1 or greater. Got: %s',
                $maxDepth
            ));
        }

        $this->maxDepth = $maxDepth;
    }
public function setMaxDepth ( $ maxDepth ) { if ( ! is_int ( $ maxDepth ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The maximum depth should be an integer. Got: %s' , is_object ( $ maxDepth ) ? get_class ( $ maxDepth ) : gettype ( $ maxDepth ) ) ) ; } if ( $ maxDepth < 1 ) { throw new \ InvalidArgumentException ( sprintf ( 'The maximum depth should 1 or greater. Got: %s' , $ maxDepth ) ) ; } $ this -> maxDepth = $ maxDepth ; }
Sets the maximum recursion depth.

If the depth is exceeded during decoding, an {@link DecodingnFailedException}
will be thrown.

A depth of zero means that objects are not allowed. A depth of one means
only one level of objects or arrays is allowed.

@param int $maxDepth The maximum recursion depth

@throws \InvalidArgumentException If the depth is not an integer greater
than or equal to zero
Sets the maximum recursion depth .