PHP Curl Class helper
2b755c6adc
Update pre-commit dependencies ( #1193 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-28 18:37:25 +00:00
Zach Borboa
e0b5f7b629
Stop phpstan failing on CURLStringFile under PHP 8.0
2026-09-08 21:29:17 -04:00
PHP Curl Class helper
e1da796b8b
Update pre-commit dependencies ( #1176 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Zach Borboa <zachborboa@gmail.com >
2026-09-02 00:35:14 +00:00
PHP Curl Class helper
5c51dfc08f
Update pre-commit dependencies ( #1160 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Zach Borboa <zachborboa@gmail.com >
2026-08-13 21:51:15 +00:00
PHP Curl Class helper
392a50b4e0
Update pre-commit dependencies ( #1141 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Zach Borboa <zachborboa@gmail.com >
2026-07-21 02:30:04 +00:00
PHP Curl Class helper
a345388ce6
Update pre-commit dependencies ( #1109 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-18 18:58:51 +00:00
PHP Curl Class helper
cfa95f457d
Update pre-commit dependencies ( #1094 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-30 13:15:00 +00:00
PHP Curl Class helper
37a1a00d95
Update pre-commit dependencies ( #1090 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-27 18:50:51 +00:00
Zach Borboa
1d50c96014
Implement CookieArray for handling decoded cookie name lookup ( #1078 )
2026-04-19 22:20:08 -04:00
Zach Borboa
59671be4b9
Add support for PHPUnit 13 in run_phpunit.sh
2026-04-06 23:16:25 -04:00
Zach Borboa
fcc64db030
Fix run.sh to forward CLI args to phpunit and error on unhandled phpunit versions
2026-04-06 23:12:35 -04:00
Zach Borboa
8840b86b92
Bump supported version for psalm checks ( #1059 )
2026-03-19 05:42:25 -07:00
PHP Curl Class helper
2633be69f9
Update pre-commit dependencies ( #1054 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Zach Borboa <zachborboa@gmail.com >
2026-03-12 20:11:33 +00:00
PHP Curl Class helper
f003fb5e36
Update pre-commit dependencies ( #1053 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-09 18:38:45 +00:00
PHP Curl Class helper
bf61251c49
Update pre-commit dependencies ( #1050 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-02 18:34:37 +00:00
Zach Borboa
06dc90ebf7
Fix typo
2026-03-01 22:34:09 -05:00
Zach Borboa
42c052f375
Fix flaky test using larger response size and slower download speed
2026-03-01 22:04:11 -05:00
PHP Curl Class helper
1247a614e1
Update pre-commit dependencies ( #1048 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-19 18:40:15 +00:00
PHP Curl Class helper
5a4323eb71
Update pre-commit dependencies ( #1046 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-10 18:44:17 +00:00
PHP Curl Class helper
6300a2e917
Update pre-commit dependencies ( #1039 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-19 16:27:41 -05:00
github-actions[bot]
616facf849
Update pre-commit dependencies
2025-12-08 18:06:39 +00:00
Zach Borboa
f01d24f68a
Use WeakMap for active handle tracking ( #1020 )
...
* Use WeakMap for active handle tracking
- Replaces array-based tracking with PHP 8.0 \WeakMap
- Replaces an O(N) lookup with an O(1) lookup in the MultiCurl execution loop
* Fix tests
2025-11-21 21:36:54 -05:00
Zach Borboa
c46ef2a858
Add PHP 8.5 ( #1018 )
...
* Add PHP 8.5 to continuous integration tests
* Use variable
* Add temporary skip
* Allow PHP CS Fixer to run on unsupported PHP versions
2025-11-21 09:13:38 -05:00
Zach Borboa
4b36f455dd
Simplify MultiCurl execution loop ( #1017 )
...
* Clean up
* Simplify MultiCurl execution loop
- Removes legacy workarounds
- Deprecates MultiCurl::setRequestTimeAccuracy()
- Removes use of CURLM_CALL_MULTI_PERFORM ("As of cURL 7.20.0, this constant is not used")
2025-11-20 23:39:03 -05:00
Zach Borboa
f058672e6f
Improve MultiCurl::waitUntilRequestQuotaAvailable ( #1016 )
...
* Include keyword
* Use numeric literal separators
* Improve waitUntilRequestQuotaAvailable using new TimeUtil
2025-11-16 14:58:13 -05:00
Zach Borboa
4bf7292438
Fix rate limit ( #1015 )
...
* Rate limit fix
If $elapsed_seconds > $this->intervalSeconds the first time hasRequestQuota() is called, rateLimitReached is never set to true and the limit is not enforced
This can happen if the rate limit is set in a callback function some time after starting
I completely removed $rateLimitReached since its only use was in the removed condition check
Alternatively, it should be possible to reinitialize currentStartTime when setRateLimit is called, but I still don't really see the usefulness of resetting the timer only when the limit was reached in the previous interval
* Rename variable
* Clean up
---------
Co-authored-by: Riccardo Nava <116394015+ricnava00@users.noreply.github.com >
2025-11-15 17:08:55 -05:00
github-actions[bot]
6a9751946b
Update pre-commit dependencies
2025-11-12 18:06:25 +00:00
github-actions[bot]
d749d0fe34
Update pre-commit dependencies
2025-11-10 18:06:18 +00:00
Zach Borboa
7e724dc9b8
Remove calls to deprecated functions ( #1005 )
...
* Fix phpcs warning
FILE: ./src/Curl/Curl.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
239 | WARNING | Function curl_close() is deprecated since PHP 8.5
| | (PHPCompatibility.FunctionUse.RemovedFunctions.curl_closeDeprecated)
-----------------------------------------------------------------------------------------------------------------
* Fix phpcs warning
FILE: ./tests/Helper.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
126 | WARNING | Function finfo_close() is deprecated since PHP 8.5
| | (PHPCompatibility.FunctionUse.RemovedFunctions.finfo_closeDeprecated)
-----------------------------------------------------------------------------------------------------------------
* Fix psalm error
ERROR: UnusedBaselineEntry - ../src/Curl/Curl.php:0:0 - Baseline for
issue "PossiblyInvalidArgument" has 1 extra entry. (see
https://psalm.dev/316 )
2025-11-01 23:48:41 -04:00
github-actions[bot]
31e2c8c824
Update pre-commit dependencies
2025-10-13 18:05:26 +00:00
github-actions[bot]
d88294bdf2
Update pre-commit dependencies
2025-10-02 18:05:22 +00:00
github-actions[bot]
c4c8faf01d
Update pre-commit dependencies
2025-10-01 18:05:23 +00:00
github-actions[bot]
e4bdfc0647
Update pre-commit dependencies
2025-09-22 18:05:24 +00:00
Zach Borboa
a79e21b0d1
Fix PHP_CodeSniffer coding standard errors ( #993 )
...
* Fix PHP_CodeSniffer errors
Error message:
Header blocks must be separated by a single blank line (PSR12.Files.FileHeader.SpacingAfterTagBlock)
* Fix PHP_CodeSniffer errors
Error message:
Opening brace should be on a new line (Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine)
* Fix PHP_CodeSniffer warnings
Error message:
A file should declare new symbols (classes, functions, constants, etc.)
and cause no other side effects, or it should execute logic with side
effects, but should not do both. The first symbol is defined on line 6
and the first side effect is on line 14.
(PSR1.Files.SideEffects.FoundWithSymbols)
2025-09-15 21:24:22 -04:00
github-actions[bot]
c19336eaa9
Update pre-commit dependencies
2025-07-31 18:05:57 +00:00
Zach Borboa
a95eef5fa3
Remove PHP CS Fixer workaround ( #963 )
...
* Remove PHP CS Fixer workaround
* Clean up
2025-07-07 01:49:43 -04:00
github-actions[bot]
8f40a7d796
Update pre-commit dependencies
2025-06-23 18:05:44 +00:00
github-actions[bot]
eb3180dbce
Update pre-commit dependencies
2025-03-31 18:05:18 +00:00
Zach Borboa
202e857e85
Drop support for PHP 7.4 ( #937 )
2025-03-24 19:45:12 -04:00
Zach Borboa
45a7b1b671
Add methods like Curl::setGet() for each HTTP request method ( #936 )
...
* Adding methods like Curl::setGet() for each HTTP request method
Adding these methods to separate the request initialization from the
execution.
Methods added:
Curl::setDelete()
Curl::setGet()
Curl::setHead()
Curl::setOptions()
Curl::setPatch()
Curl::setPost()
Curl::setPut()
Curl::setSearch()
* Fix loading local test servers
Error message:
+++ declare -A pids
run_phpunit.sh: line 77: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
Error message:
+++ server_count=7
+++ pids=()
run_phpunit.sh: line 85: "7" - 1: syntax error: operand expected (error token is ""7" - 1")
* Clean up
2025-03-23 05:00:39 -04:00
Zach Borboa
41cc699798
Display summary of warnings ( #932 )
2025-03-08 13:44:18 -05:00
Zach Borboa
8d83782c06
Use PHPStan bleeding edge ( #931 )
2025-03-08 10:45:51 -05:00
Zach Borboa
a64fad2a9d
Fix psalm install error on future php releases ( #930 )
...
* Skip running psalm on future PHP releases
* Clean up indentation
2025-03-08 09:18:08 -05:00
Zach Borboa
58962a054e
Fix PHPStan static analysis errors ( #929 )
...
* Increase PHPStan memory limit on local development
* Add emjois to test warnings and test errors
* Fix PHPStan static analysis errors
Error messages:
------ ------------------------------------------------------------------------------------------------------
Line src/Curl/Curl.php
------ ------------------------------------------------------------------------------------------------------
123 Cannot unset property Curl\Curl::$curlErrorCodeConstant because it might have hooks in a subclass.
🪪 unset.possiblyHookedProperty
124 Cannot unset property Curl\Curl::$curlErrorCodeConstants because it might have hooks in a subclass.
🪪 unset.possiblyHookedProperty
125 Cannot unset property Curl\Curl::$curlOptionCodeConstants because it might have hooks in a subclass.
🪪 unset.possiblyHookedProperty
126 Cannot unset property Curl\Curl::$effectiveUrl because it might have hooks in a subclass.
🪪 unset.possiblyHookedProperty
127 Cannot unset property Curl\Curl::$rfc2616 because it might have hooks in a subclass.
🪪 unset.possiblyHookedProperty
128 Cannot unset property Curl\Curl::$rfc6265 because it might have hooks in a subclass.
🪪 unset.possiblyHookedProperty
129 Cannot unset property Curl\Curl::$totalTime because it might have hooks in a subclass.
🪪 unset.possiblyHookedProperty
564 Cannot unset property Curl\Curl::$curlErrorCodeConstant because it might have hooks in a subclass.
🪪 unset.possiblyHookedProperty
565 Cannot unset property Curl\Curl::$effectiveUrl because it might have hooks in a subclass.
🪪 unset.possiblyHookedProperty
566 Cannot unset property Curl\Curl::$totalTime because it might have hooks in a subclass.
🪪 unset.possiblyHookedProperty
------ ------------------------------------------------------------------------------------------------------
2025-03-08 08:34:45 -05:00
github-actions[bot]
b96527cfc6
Update pre-commit dependencies
2025-02-27 18:05:04 +00:00
Zach Borboa
2cc50bd15e
Actually increase psalm strictness ( #926 )
2025-02-19 22:13:10 -05:00
Zach Borboa
4cf4635e25
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 baseline
2025-02-19 21:40:56 -05:00
Zach Borboa
056de7d13d
Use default for Psalm ensureOverrideAttribute ( #923 )
...
* Use default for Psalm ensureOverrideAttribute
* Fix missing Override attributes
Error: ../src/Curl/CaseInsensitiveArray.php:66:5:
MissingOverrideAttribute: Method Curl\CaseInsensitiveArray::offsetset
should have the "Override" attribute (see https://psalm.dev/358 )
2025-02-18 21:49:22 -05:00
Zach Borboa
d05e75aa14
Check for composer installation failure ( #924 )
2025-02-17 20:34:41 -05:00
Zach Borboa
86eb0d1059
Merge branch 'master' into create-pull-request/patch
2025-02-17 18:53:56 -05:00