Releases: somework/offset-page
Releases · somework/offset-page
3.0.0
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:
PaginationExceptionInterfacefor type-safe exception catchingPaginationExceptionas base exception classInvalidPaginationArgumentExceptionfor parameter validation errorsInvalidPaginationResultExceptionfor 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 invalidlimit=0combinations - Added deterministic loop guards to prevent infinite pagination
- Enhanced
SourceInterfacedocumentation with comprehensive behavioral specifications
Changed
- BREAKING: Renamed
OffsetResult::getTotalCount()toOffsetResult::getFetchedCount()for semantic clarity - BREAKING: Removed
SourceResultInterfaceandSourceResultCallbackAdapterto simplify architecture - BREAKING:
OffsetResultno longer implementsSourceResultInterface - BREAKING:
SourceInterface::execute()now returns\Generator<T>directly instead of wrapped interface - Enhanced type safety with
positive-inttypes inSourceInterfacePHPDoc - Reorganized test methods for better logical flow and maintainability
- Improved property visibility (changed some
protectedtoprivateinOffsetResult) - Updated
SourceCallbackAdapterwith enhanced validation and error messages
Removed
- Removed
SourceResultInterfaceandSourceResultCallbackAdapterclasses - Removed
ArraySourceResulttest utility class - Removed
SourceResultCallbackAdapterTesttest 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