|
1 | 1 | <?php |
| 2 | + |
2 | 3 | /** |
3 | 4 | * This file contains all the functions that could not be dealt with automatically using the code generator. |
4 | 5 | * If you add a function in this list, do not forget to add it in the generator/config/specialCasesFunctions.php |
|
7 | 8 |
|
8 | 9 | namespace Safe; |
9 | 10 |
|
10 | | -use Safe\Exceptions\FilesystemException; |
11 | | -use const PREG_NO_ERROR; |
12 | | - |
13 | 11 | use Safe\Exceptions\MiscException; |
14 | 12 | use Safe\Exceptions\PosixException; |
15 | 13 | use Safe\Exceptions\SocketsException; |
|
19 | 17 | use Safe\Exceptions\OpensslException; |
20 | 18 | use Safe\Exceptions\PcreException; |
21 | 19 | use Safe\Exceptions\SimplexmlException; |
| 20 | +use Safe\Exceptions\FilesystemException; |
| 21 | + |
| 22 | +use const PREG_NO_ERROR; |
22 | 23 |
|
23 | 24 | /** |
24 | 25 | * Wrapper for json_decode that throws when an error occurs. |
@@ -157,7 +158,7 @@ function apcu_fetch($key) |
157 | 158 | * @throws PcreException |
158 | 159 | * |
159 | 160 | */ |
160 | | -function preg_replace($pattern, $replacement, $subject, int $limit = -1, int &$count = null) |
| 161 | +function preg_replace($pattern, $replacement, $subject, int $limit = -1, ?int &$count = null) |
161 | 162 | { |
162 | 163 | error_clear_last(); |
163 | 164 | $result = \preg_replace($pattern, $replacement, $subject, $limit, $count); |
@@ -394,7 +395,6 @@ function fputcsv($stream, array $fields, string $separator = ",", string $enclos |
394 | 395 | { |
395 | 396 | error_clear_last(); |
396 | 397 | if (PHP_VERSION_ID >= 80100) { |
397 | | - /** @phpstan-ignore-next-line */ |
398 | 398 | $result = \fputcsv($stream, $fields, $separator, $enclosure, $escape, $eol); |
399 | 399 | } else { |
400 | 400 | $result = \fputcsv($stream, $fields, $separator, $enclosure, $escape); |
@@ -431,7 +431,7 @@ function fputcsv($stream, array $fields, string $separator = ",", string $enclos |
431 | 431 | * @throws FilesystemException |
432 | 432 | * |
433 | 433 | */ |
434 | | -function fgetcsv($stream, int $length = null, string $separator = ",", string $enclosure = "\"", string $escape = "\\"): array|false |
| 434 | +function fgetcsv($stream, ?int $length = null, string $separator = ",", string $enclosure = "\"", string $escape = "\\"): array|false |
435 | 435 | { |
436 | 436 | error_clear_last(); |
437 | 437 | $safeResult = \fgetcsv($stream, $length, $separator, $enclosure, $escape); |
|
0 commit comments