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