Releases: FriendsOfOuro/http-batch-guzzle
Releases Β· FriendsOfOuro/http-batch-guzzle
HTTP Batch Guzzle 3.1.0
β¨ New Features
- Add RecordingHttpClient spy for testing HTTP interactions
- Comprehensive HTTP interaction recording for both single and batch requests
- Records requests, responses, and exceptions with detailed inspection APIs
- Supports filtering successful/failed requests and batch operations
- Provides chronological interaction history for debugging and testing
- Full compatibility with existing ClientInterface implementations
π οΈ Improvements
- Enhanced testing capabilities
- Complete test coverage for RecordingHttpClient functionality
- Batch request recording with individual request/response tracking
- Exception recording for both single and batch operations
- Rich inspection APIs for test assertions and debugging
Full Changelog
Full Changelog: v3.0.0...v3.1.0
v3.0.0 - Complete HTTP Batch Guzzle Implementation
π HTTP Batch Guzzle v3.0.0
π¨ Breaking Changes
This major release implements the new http-batch-contract v3.0 with significant API improvements:
Method Signature Changes
filter()now returnsstaticinstead ofarrayfor fluent interface supportgetSuccessfulResults()βgetResponses()returningResponseInterface[]getFailedResults()βgetExceptions()returningClientExceptionInterface[]
Migration Guide
Before (v1.x):
$batch = $client->sendRequestBatch($requests);
$results = $batch->getSuccessfulResults(); // BatchItemInterface[]
$failures = $batch->getFailedResults(); // BatchItemInterface[]
$filtered = $batch->filter($predicate); // BatchItemInterface[]After (v3.x):
$batch = $client->sendRequestBatch($requests);
$responses = $batch->getResponses(); // ResponseInterface[]
$exceptions = $batch->getExceptions(); // ClientExceptionInterface[]
$filtered = $batch->filter($predicate); // static (same type as $batch)β¨ Quality Improvements
Test Coverage Excellence
- 31 comprehensive tests with 71 assertions
- 94.19% line coverage and 90.91% method coverage
- Complete unit tests for
BatchItemandResponseBatchclasses - Eliminated risky tests with proper
#[UsesClass]attributes
Code Quality Enhancements
- Improved type safety with
assert()for better error handling - Fixed array indexing issues in filtered results
- Modern PHP practices and cleaner code structure
- Enhanced error messages and exception handling
Dependencies
- Requires:
friendsofouro/http-batch-contract: ^3.0 - Provides:
friendsofouro/http-batch-implementation: ^3.0 - Compatible with: PHP 8.4+, Guzzle 7.10+
π Migration Required
This release contains breaking changes. Please update your code to use the new method names and return types. See the migration guide above for details.
For detailed contract changes, see: http-batch-contract v3.0.0
π€ Generated with Claude Code
v2.0.1
Patch Release: Virtual Package Version Update
Changes
- Virtual Package: Updated provided
friendsofouro/http-batch-implementationversion from ^1.0 to ^2.0
This allows packages depending on the virtual package to require version ^2.0 and get this implementation.
Full Changelog: v2.0.0...v2.0.1
v2.0.0
π Major Release: Upgrade to http-batch-contract v2.0
Breaking Changes
- sendRequestBatch() now returns
ResponseBatchInterfaceinstead of array - Exceptions are no longer thrown during batch processing, they're captured in results
New Features
- BatchItem: Implementation of
BatchItemInterfacefor individual request/response pairs - ResponseBatch: Implementation of
ResponseBatchInterfacewith fullCountablesupport - Exception Handling: Network/client errors are now part of the batch results instead of interrupting the entire batch
- Rich Utility Methods: Access to
isCompleteSuccess(),hasAnyFailures(),getSuccessfulResults(),getFailedResults(), andfilter() - Custom Exceptions:
ResponseUnavailableExceptionandExceptionUnavailableExceptionfor type-safe error handling
Migration Guide
Before (v1.x):
try {
$responses = $client->sendRequestBatch($requests);
foreach ($responses as $response) {
// Process response
}
} catch (\Exception $e) {
// Handle batch failure
}After (v2.0):
$batch = $client->sendRequestBatch($requests);
if ($batch->isCompleteSuccess()) {
foreach ($batch->getResults() as $item) {
$response = $item->getResponse();
// Process response
}
} else {
// Handle mixed results
foreach ($batch->getSuccessfulResults() as $item) {
// Process successful responses
}
foreach ($batch->getFailedResults() as $item) {
$exception = $item->getException();
// Handle individual failures
}
}Dependencies
- Requires
friendsofouro/http-batch-contractv2.0 - PHP 8.4+
- Guzzle 7.10+
Full Changelog: v1.0.0...v2.0.0