-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change HTTP client in symfony/cache to Curl #296
Conversation
The HTTP client used in 'HttpResourceObject' has been switched from Symfony's HttpClient to cURL for better functionality and flexibility. This includes separate handling for response headers and body, support for various content types and improved error handling. Necessary constants and functions have been added and relevant tests have been updated accordingly.
Refactor HTTP Request processing in HttpResourceObject The HTTP request processing method in HttpResourceObject has been significantly refactored for clarity and efficiency. The adjustments include the reconsideration of how the request body is encoded, the simplification of handling different content types, and the elimination of unnecessary methods in the HttpResourceObjectTest. Also, better type safety has been added with more type hinting and assertions.
The function `setProps` in `HttpResourceObject` has been renamed to `httpRequest` to better reflect its purpose. The change is applied in both the method definition and its usage site, with no change in the parameters or the method body.
"ext-curl" was added to the list of requirements in composer.json. This ensures necessary curl extension for handling HTTP requests is available for the application, improving the project's code organization and maintainability.
…stCurl The HttpAccessCurl class has been extensively refactored which involved renaming it to HttpRequestCurl. HTTP request functions and methods have been removed from HttpResourceObject and added to HttpRequestCurl instead. This includes changing the httpRequest method to return an array instead of modifying a ResourceObject in-place. Also, methods were updated to improve error checking and clarity.
Important Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 概要この変更では、HTTPリクエストの処理方法がcURLを使用する方式に変更されました。 変更
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@coderabbitai review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
HttpClientProvider class and several dependencies related to it have been removed from the project. The HttpClientModule has been refactored to bring about better efficiency in handling HTTP requests and improve overall code clarity. It now makes use of HttpRequestCurl instead of HttpClientInterface.
Symphony's HttpClientInterface was replaced with BEAR's HttpRequestCurl in the HttpClientModule. This change aims to streamline the handling of HTTP requests, improve code clarity, and offload dependencies tied
The HttpRequestCurl class was refactored to improve code readability and simplicity. The unnecessary CURLFile import was removed, the PHPStan ignore line was cleaned up, and multipart form-data handling was stripped due to its redundancy. This results in a leaner, more focused HTTP request implementation.
The HttpRequestCurl class was refactored, improving readability and reducing complexity. The conditionally setting of Curl options has been extracted into a new method, setCurlRequestPayload. This change makes the code cleaner and easier to understand. Furthermore, the CURLFile import has been removed as it was not needed.
This commit focuses on refactoring the HttpRequestCurl class to enhance its type safety. Various changes have been made including removing unnecessary functions, adding type annotations, splitting a complex function into smaller, more manageable ones, and changing the way headers are processed. This will help improve code readability, maintenance and reduce potential typing errors.
This commit refactors the HttpRequestCurl class to increase type safety. Removed redundant assertions, added type assertions for method parameters, and streamlined header processing. These
This commit refines the HttpRequestCurl class to improve type safety and code clarity. By introducing explicit type checks for method parameters and simplifying header handling, not only is the code readability improved but also potential typing errors are minimized.
The HttpRequestCurl class has been updated to improve type safety and readability of the code. The changes include refining method parameters to use explicit types, simplifying the handling of content types in headers, and eliminating the unnecessary encoding section. This aims to minimize the potential for typing errors and boost the efficiency of requests made by the HTTP client.
The HttpRequestCurl now implements a new HttpRequestInterface, resulting in a more robust and flexible design. The switch over from HttpRequestCurl to HttpRequestInterface in HttpResourceObject and HttpClientModule is reflected aswell. Additionlly, tests and server-side scripts have been updated to handle HTML responses and accompanying headers properly. This enhances the system's capability to handle different types of requests and makes the test suite more comprehensive.
The 'nikic/php-parser' dependency has been removed from the project files. This change is reflected in the composer.json file where the associated line has been deleted. Now the project relies on fewer third-party packages, thereby reducing potential security risks and improving overall application performance.
Co-authored-by: Naoki Tsuchiya <ntsuchiya1105@gmail.com>
Co-authored-by: Naoki Tsuchiya <ntsuchiya1105@gmail.com>
Co-authored-by: Naoki Tsuchiya <ntsuchiya1105@gmail.com>
This commit removes an extraneous line of whitespace from the HttpRequestCurl
Summary by CodeRabbit
新機能
バグ修正
リファクタリング
HttpRequestInterface
に委任するようにHttpResourceObject
クラスが大幅にリファクタリングされました。その他の変更