Introduce a draft for a generic reusable HTTP client builder#45
Merged
veewee merged 1 commit intophpro:v2.xfrom Dec 2, 2025
Merged
Introduce a draft for a generic reusable HTTP client builder#45veewee merged 1 commit intophpro:v2.xfrom
veewee merged 1 commit intophpro:v2.xfrom
Conversation
|
Looks very promising 😍 |
c6ace9e to
f94bd32
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces reusable builder classes for configuring HTTP clients and formatters, simplifying the setup process for complex HTTP client configurations with plugins, authentication, logging, and sensitive data masking.
Key changes:
- Added
ClientBuilderclass with fluent API for configuring HTTP clients with plugins, authentication, logging, base URIs, headers, and recording capabilities - Added
FormatterBuilderclass with fluent API for configuring message formatters with debugging and decorator support - Added static factory methods (
createDecorator) to sensitive data formatter classes for easier integration with the builder pattern
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Client/ClientBuilder.php | New builder class providing fluent API for HTTP client configuration with support for plugins, authentication, logging, and more |
| src/Formatter/FormatterBuilder.php | New builder class for configuring message formatters with debug mode, body length limits, and decorators |
| src/Formatter/RemoveSensitiveHeadersFormatter.php | Added createDecorator static factory method for builder integration |
| src/Formatter/RemoveSensitiveJsonKeysFormatter.php | Added createDecorator static factory method for builder integration |
| src/Formatter/RemoveSensitiveQueryStringsFormatter.php | Added createDecorator static factory method for builder integration |
| tests/Unit/Client/ClientBuilderTest.php | Comprehensive test coverage for ClientBuilder functionality |
| tests/Unit/Formatter/FormatterBuilderTest.php | Comprehensive test coverage for FormatterBuilder functionality |
| tests/Unit/Formatter/RemoveSensitiveHeaderKeysFormatterTest.php | Added test for createDecorator factory method |
| tests/Unit/Formatter/RemoveSensitiveJsonKeysFormatterTest.php | Added test for createDecorator factory method |
| tests/Unit/Formatter/RemoveSensitiveQueryStringsFormatterTest.php | Added test for createDecorator factory method |
| README.md | Added documentation and examples for using the new builder classes |
| docs/framework/symfony.md | Removed Symfony-specific documentation (moved or consolidated elsewhere) |
| docs/framework/magento2.md | Removed Magento2-specific documentation (moved or consolidated elsewhere) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d3ffb00 to
ad95bf7
Compare
ad95bf7 to
812fe88
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary