Commit 4cf4635
authored
Increase psalm strictness (#925)
* Fix PossiblyUndefinedArrayOffset
ERROR: PossiblyUndefinedArrayOffset - ../src/Curl/Curl.php:1890:28 -
Possibly undefined array key (see https://psalm.dev/167)
list($key, $value) = explode(':', $raw_headers[$i], 2);
* Fix PossiblyUndefinedArrayOffset
ERROR: PossiblyUndefinedArrayOffset - ../src/Curl/Curl.php:1034:28 -
Possibly undefined array key (see https://psalm.dev/167)
list($key, $value) = explode(':', $header, 2);
* Fix PossiblyUndefinedArrayOffset
ERROR: PossiblyUndefinedArrayOffset - ../src/Curl/MultiCurl.php:465:28 -
Possibly undefined array key (see https://psalm.dev/167)
list($key, $value) = explode(':', $header, 2);
* Fix PossiblyInvalidOperand
ERROR: PossiblyInvalidOperand - ../src/Curl/Curl.php:1407:69 - Cannot
concatenate with a int<0, max>|string (see https://psalm.dev/163)
echo 'Response content length (calculated): ' . $response_calculated_length . "\n";
* Fix PossiblyInvalidArgument
ERROR: PossiblyInvalidArgument - ../src/Curl/BaseCurl.php:408:34 -
Argument 2 of define expects array<array-key, mixed>|null|scalar, but
possibly different type false|resource provided (see
https://psalm.dev/092)
define('STDERR', fopen('php://stderr', 'wb'));
* Fix ArgumentTypeCoercion
ERROR: ArgumentTypeCoercion - ../src/Curl/MultiCurl.php:956:16 -
Argument 1 of usleep expects int<0, max>, but parent type int provided
(see https://psalm.dev/193)
usleep((int) $sleep_seconds * 1000000);
* Fix PossiblyFalseArgument
ERROR: PossiblyFalseArgument - ../src/Curl/MultiCurl.php:131:50 -
Argument 2 of file_put_contents cannot be false, possibly
array<array-key, string>|resource|string value expected (see
https://psalm.dev/104)
file_put_contents($filename, stream_get_contents($fh));
* Fix PossiblyFalseArgument
ERROR: PossiblyFalseArgument - ../src/Curl/Curl.php:437:49 - Argument 2
of stream_copy_to_stream cannot be false, possibly resource value
expected (see https://psalm.dev/104)
stream_copy_to_stream($tmpfile, $fh);
ERROR: PossiblyFalseArgument - ../src/Curl/Curl.php:438:24 - Argument 1
of fclose cannot be false, possibly resource value expected (see
https://psalm.dev/104)
fclose($fh);
* Fix PossiblyFalseArgument
ERROR: PossiblyFalseArgument - ../src/Curl/Curl.php:463:49 - Argument 2
of stream_copy_to_stream cannot be false, possibly resource value
expected (see https://psalm.dev/104)
stream_copy_to_stream($file_handle, $main_file_handle);
ERROR: PossiblyFalseArgument - ../src/Curl/Curl.php:468:16 - Argument 1
of fclose cannot be false, possibly resource value expected (see
https://psalm.dev/104)
fclose($main_file_handle);
* Fix PossiblyFalseArgument
ERROR: PossiblyFalseArgument - ../src/Curl/Curl.php:1891:36 - Argument 1
of count cannot be false, possibly Countable|array<array-key, mixed>
value expected (see https://psalm.dev/104)
$raw_headers_count = count($raw_headers);
ERROR: PossiblyInvalidArrayAccess - ../src/Curl/Curl.php:1893:24 -
Cannot access array value on non-array variable $raw_headers of type
false (see https://psalm.dev/109)
if (strpos($raw_headers[$i], ':') !== false) {
* Fix PossiblyInvalidArgument
ERROR: PossiblyInvalidArgument - ../src/Curl/Curl.php:1868:30 - Argument
2 of define expects array<array-key, mixed>|null|scalar, but possibly
different type false|resource provided (see https://psalm.dev/092)
define('STDOUT', fopen('php://stdout', 'w'));
* Update psalm baseline1 parent 4d126ef commit 4cf4635
File tree
4 files changed
+52
-15
lines changed- src/Curl
- tests
4 files changed
+52
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
408 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
409 | 411 | | |
410 | | - | |
411 | 412 | | |
412 | 413 | | |
413 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | | - | |
434 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
435 | 437 | | |
436 | 438 | | |
437 | 439 | | |
| |||
447 | 449 | | |
448 | 450 | | |
449 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
450 | 455 | | |
451 | 456 | | |
452 | 457 | | |
| |||
1031 | 1036 | | |
1032 | 1037 | | |
1033 | 1038 | | |
1034 | | - | |
| 1039 | + | |
1035 | 1040 | | |
1036 | 1041 | | |
1037 | 1042 | | |
| |||
1404 | 1409 | | |
1405 | 1410 | | |
1406 | 1411 | | |
1407 | | - | |
| 1412 | + | |
1408 | 1413 | | |
1409 | 1414 | | |
1410 | 1415 | | |
| |||
1859 | 1864 | | |
1860 | 1865 | | |
1861 | 1866 | | |
1862 | | - | |
1863 | | - | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
1864 | 1871 | | |
1865 | 1872 | | |
1866 | 1873 | | |
1867 | 1874 | | |
1868 | | - | |
| 1875 | + | |
1869 | 1876 | | |
1870 | 1877 | | |
1871 | 1878 | | |
| |||
1881 | 1888 | | |
1882 | 1889 | | |
1883 | 1890 | | |
1884 | | - | |
1885 | 1891 | | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
1886 | 1896 | | |
1887 | 1897 | | |
1888 | 1898 | | |
1889 | 1899 | | |
1890 | | - | |
| 1900 | + | |
1891 | 1901 | | |
1892 | 1902 | | |
1893 | 1903 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
| |||
462 | 465 | | |
463 | 466 | | |
464 | 467 | | |
465 | | - | |
| 468 | + | |
466 | 469 | | |
467 | 470 | | |
468 | 471 | | |
| |||
946 | 949 | | |
947 | 950 | | |
948 | 951 | | |
949 | | - | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
950 | 959 | | |
951 | 960 | | |
952 | 961 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
8 | 25 | | |
9 | 26 | | |
0 commit comments