| @@ 173-184 (lines=12) @@ | ||
| 170 | * |
|
| 171 | * @return self |
|
| 172 | */ |
|
| 173 | public function withRecursionDepth($depth) |
|
| 174 | { |
|
| 175 | if (null !== $depth && !(is_int($depth) && $depth >= 0)) { |
|
| 176 | $msg = 'Recursion depth must be null (infinite) or integer >= 0!'; |
|
| 177 | throw new \InvalidArgumentException($msg); |
|
| 178 | } |
|
| 179 | ||
| 180 | $self = clone $this; |
|
| 181 | $self->recursionDepth = $depth; |
|
| 182 | ||
| 183 | return $self; |
|
| 184 | } |
|
| 185 | ||
| 186 | /** |
|
| 187 | * Maximum number of iterations, null means infinite, any integer greater |
|
| @@ 196-207 (lines=12) @@ | ||
| 193 | * |
|
| 194 | * @return self |
|
| 195 | */ |
|
| 196 | public function withMaxIterations($iterations) |
|
| 197 | { |
|
| 198 | if (null !== $iterations && !(is_int($iterations) && $iterations > 0)) { |
|
| 199 | $msg = 'Maximum number of iterations must be null (infinite) or integer > 0!'; |
|
| 200 | throw new \InvalidArgumentException($msg); |
|
| 201 | } |
|
| 202 | ||
| 203 | $self = clone $this; |
|
| 204 | $self->maxIterations = $iterations; |
|
| 205 | ||
| 206 | return $self; |
|
| 207 | } |
|
| 208 | ||
| 209 | /** |
|
| 210 | * Whether shortcode content will be automatically processed and handler |
|