public function withMaxIterations($iterations)
    {
        if (null !== $iterations && !(is_int($iterations) && $iterations > 0)) {
            $msg = 'Maximum number of iterations must be null (infinite) or integer > 0!';
            throw new \InvalidArgumentException($msg);
        }

        $self = clone $this;
        $self->maxIterations = $iterations;

        return $self;
    }
public function withMaxIterations($iterations)
    {
        if (null !== $iterations && !(is_int($iterations) && $iterations > 0)) {
            $msg = 'Maximum number of iterations must be null (infinite) or integer > 0!';
            throw new \InvalidArgumentException($msg);
        }

        $self = clone $this;
        $self->maxIterations = $iterations;

        return $self;
    }
public function withMaxIterations ( $ iterations ) { if ( null !== $ iterations && ! ( is_int ( $ iterations ) && $ iterations > 0 ) ) { $ msg = 'Maximum number of iterations must be null (infinite) or integer > 0!' ; throw new \ InvalidArgumentException ( $ msg ) ; } $ self = clone $ this ; $ self -> maxIterations = $ iterations ; return $ self ; }
Maximum number of iterations, null means infinite, any integer greater
than zero sets value. Zero is invalid because there must be at least one
iteration. Defaults to 1. Loop breaks if result of two consequent
iterations shows no change in processed text.

@param int|null $iterations

@return self
Maximum number of iterations null means infinite any integer greater than zero sets value . Zero is invalid because there must be at least one iteration . Defaults to 1 . Loop breaks if result of two consequent iterations shows no change in processed text .