Skip to content

v3.0.0 - Complete HTTP Batch Guzzle Implementation

Choose a tag to compare

@dbellettini dbellettini released this 26 Sep 15:01
· 3 commits to main since this release

πŸš€ 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