Skip to content

Remove deprecated curl_close calls#61

Open
ChiragAgg5k wants to merge 1 commit intomainfrom
codex/remove-curl-close-php85
Open

Remove deprecated curl_close calls#61
ChiragAgg5k wants to merge 1 commit intomainfrom
codex/remove-curl-close-php85

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

What does this PR do?

Removes calls to curl_close(). Since PHP 8.0, cURL handles are CurlHandle objects and curl_close() no longer has an effect; handles are released by object lifetime instead. Removing these calls avoids noisy PHP 8.5 deprecation warnings without changing behavior for supported PHP versions.

Test Plan

  • Ran php -l on changed PHP files where applicable.
  • Confirmed no curl_close(...) calls remain in this repository.

Related PRs and Issues

N/A

Have you read the Contributing Guidelines on issues?

Yes.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 29, 2026

Greptile Summary

This PR removes the try/finally block in Adapter::call() that previously ensured curl_close($ch) was always called. Since PHP 8.0, CurlHandle is a proper object whose lifetime is managed by PHP's reference-counting GC, making explicit curl_close() a no-op (and deprecated in PHP 8.4/8.5). The error-handling logic and exception-throwing paths are fully preserved; only the now-unnecessary cleanup call is removed.

Confidence Score: 5/5

Safe to merge — the change is correct, minimal, and behavior-preserving on PHP 8.0+.

Removing curl_close() in the finally block is the correct fix for PHP 8.0+ where the call is a no-op and deprecated in 8.4/8.5. All exception-throwing paths are retained unchanged; resource cleanup is handled automatically by object lifetime.

No files require special attention.

Important Files Changed

Filename Overview
src/Analytics/Adapter.php Removes try/finally block and curl_close($ch) call from the call() method; cURL handle cleanup is now handled by PHP 8.0+ object lifetime/GC.

Reviews (1): Last reviewed commit: "Remove deprecated curl_close calls" | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant