Skip to content

v3.0.0 - Breaking Interface Changes

Latest

Choose a tag to compare

@dbellettini dbellettini released this 26 Sep 14:34
· 2 commits to main since this release

🚨 Breaking Changes

This release contains breaking changes to the ResponseBatchInterface:

Method Signature Changes

  • filter() now returns static instead of array for better fluent interface support
  • getSuccessfulResults() renamed to getResponses() and returns ResponseInterface[]
  • getFailedResults() renamed to getExceptions() and returns ClientExceptionInterface[]

Migration Guide

Before (v2.x):

$batch = $client->batch($requests);
$results = $batch->getSuccessfulResults(); // BatchItemInterface[]
$failures = $batch->getFailedResults();   // BatchItemInterface[]
$filtered = $batch->filter($predicate);   // BatchItemInterface[]

After (v3.x):

$batch = $client->batch($requests);
$responses = $batch->getResponses();       // ResponseInterface[]
$exceptions = $batch->getExceptions();     // ClientExceptionInterface[]
$filtered = $batch->filter($predicate);   // static (same type as $batch)

Benefits

  • βœ… Better type safety with specific return types
  • βœ… More semantic method names (getResponses vs getSuccessfulResults)
  • βœ… Fluent interface support with filter() returning static
  • βœ… Direct access to responses and exceptions without wrapping

πŸ€– Generated with Claude Code