Skip to content

Releases: somework/offset-page

3.0.0

05 Dec 16:55
e14e0ec

Choose a tag to compare

What's Changed

  • v3.0: Refactor exception architecture and simplify API with generator-based returns by @somework in #7
  • ci(deps): bump actions/upload-artifact from 4 to 5 by @dependabot[bot] in #14

Added

  • Added comprehensive exception architecture with typed exception hierarchy:
    • PaginationExceptionInterface for type-safe exception catching
    • PaginationException as base exception class
    • InvalidPaginationArgumentException for parameter validation errors
    • InvalidPaginationResultException for result validation errors
  • Added OffsetAdapter::generator() method for direct generator access
  • Added OffsetResult::empty() static factory for creating empty results
  • Added OffsetResult::generator() method for accessing internal generator
  • Added strict input validation to OffsetAdapter::execute(), rejecting negative values and invalid limit=0 combinations
  • Added deterministic loop guards to prevent infinite pagination
  • Enhanced SourceInterface documentation with comprehensive behavioral specifications

Changed

  • BREAKING: Renamed OffsetResult::getTotalCount() to OffsetResult::getFetchedCount() for semantic clarity
  • BREAKING: Removed SourceResultInterface and SourceResultCallbackAdapter to simplify architecture
  • BREAKING: OffsetResult no longer implements SourceResultInterface
  • BREAKING: SourceInterface::execute() now returns \Generator<T> directly instead of wrapped interface
  • Enhanced type safety with positive-int types in SourceInterface PHPDoc
  • Reorganized test methods for better logical flow and maintainability
  • Improved property visibility (changed some protected to private in OffsetResult)
  • Updated SourceCallbackAdapter with enhanced validation and error messages

Removed

  • Removed SourceResultInterface and SourceResultCallbackAdapter classes
  • Removed ArraySourceResult test utility class
  • Removed SourceResultCallbackAdapterTest test class
  • Removed unnecessary interface abstractions for cleaner architecture

Fixed

  • Fixed potential infinite loop scenarios in pagination logic
  • Enhanced error messages for better developer experience
  • Improved validation of pagination parameters

Dev

  • Enhanced test organization with logical method grouping
  • Added comprehensive test coverage for new exception architecture
  • Improved static analysis type safety
  • Added 31 new tests for enhanced functionality

Full Changelog: 2.0.0...3.0.0

2.0.0

04 Dec 18:28

Choose a tag to compare

What's Changed

  • feat: PHP 8.2 migration and comprehensive test suite by @somework in #4

Full Changelog: 1.1.2...2.0.0