Skip to content

Releases: FriendsOfOuro/http-batch-guzzle

HTTP Batch Guzzle 3.1.0

26 Sep 16:36

Choose a tag to compare

✨ 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

26 Sep 15:01

Choose a tag to compare

πŸš€ 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 returns static instead of array for fluent interface support
  • getSuccessfulResults() β†’ getResponses() returning ResponseInterface[]
  • getFailedResults() β†’ getExceptions() returning ClientExceptionInterface[]

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 BatchItem and ResponseBatch classes
  • 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

26 Sep 14:17

Choose a tag to compare

Patch Release: Virtual Package Version Update

Changes

  • Virtual Package: Updated provided friendsofouro/http-batch-implementation version 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

26 Sep 14:12

Choose a tag to compare

πŸš€ Major Release: Upgrade to http-batch-contract v2.0

Breaking Changes

  • sendRequestBatch() now returns ResponseBatchInterface instead of array
  • Exceptions are no longer thrown during batch processing, they're captured in results

New Features

  • BatchItem: Implementation of BatchItemInterface for individual request/response pairs
  • ResponseBatch: Implementation of ResponseBatchInterface with full Countable support
  • 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(), and filter()
  • Custom Exceptions: ResponseUnavailableException and ExceptionUnavailableException for 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-contract v2.0
  • PHP 8.4+
  • Guzzle 7.10+

Full Changelog: v1.0.0...v2.0.0