| @@ -193,9 +193,9 @@ | ||
| 193 | 193 | |
| 194 | 194 | return $str; |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - public function slice(int $start = 0, ?int $length = null): AbstractString | |
| 197 | + public function slice(int $start = 0, int $length = null): AbstractString | |
| 198 | 198 | { |
| 199 | 199 | $str = clone $this; |
| 200 | 200 | $str->string = mb_substr($this->string, $start, $length, 'UTF-8'); |
| 201 | 201 | |
| @@ -201,9 +201,9 @@ | ||
| 201 | 201 | |
| 202 | 202 | return $str; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - public function splice(string $replacement, int $start = 0, ?int $length = null): AbstractString | |
| 205 | + public function splice(string $replacement, int $start = 0, int $length = null): AbstractString | |
| 206 | 206 | { |
| 207 | 207 | if (!preg_match('//u', $replacement)) { |
| 208 | 208 | throw new InvalidArgumentException('Invalid UTF-8 string.'); |
| 209 | 209 | } |
| @@ -215,9 +215,9 @@ | ||
| 215 | 215 | |
| 216 | 216 | return $str; |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array | |
| 219 | + public function split(string $delimiter, int $limit = null, int $flags = null): array | |
| 220 | 220 | { |
| 221 | 221 | if (1 > $limit = $limit ?? \PHP_INT_MAX) { |
| 222 | 222 | throw new InvalidArgumentException('Split limit must be a positive integer.'); |
| 223 | 223 | } |