Skip to content

Add PageNotFoundException#161

Merged
vjik merged 5 commits intomasterfrom
page-not-found
Jan 30, 2024
Merged

Add PageNotFoundException#161
vjik merged 5 commits intomasterfrom
page-not-found

Conversation

@vjik
Copy link
Member

@vjik vjik commented Jan 29, 2024

Q A
Is bugfix?
New feature? ✔️
Breaks BC? ✔️

@what-the-diff
Copy link

what-the-diff bot commented Jan 29, 2024

PR Summary

  • New 'PageNotFoundException' Class Added
    A new class named 'PageNotFoundException' has been created in the Paginator source code. This will handle scenarios where a page is not found during pagination.

  • Improved Parameter Annotations in Keyset and Offset Paginators
    The KeysetPaginator and OffsetPaginator source files have new annotations to enhance code clarity and predictability. These indicate the type of variables and the expected return values of the methods. In particular, the annotations make clear that certain values should be positive or non-negative integers.

  • Switched Exception Handling to Use New Class
    The use of the older 'PaginatorException' class has been replaced with the new 'PageNotFoundException' class in the 'read()' and 'isOnFirstPage()' methods within various Paginator files, offering more specific and accurate exception handling.

  • Update to Test Expectations
    In the testing file 'OffsetPaginatorTest.php', the expected exceptions in multiple methods are now aligned with the newly introduced 'PageNotFoundException' class. Further, a test that was previously expected to throw an exception, testGetCurrentPageCannotBeLargerThanMaxPages, has been revised to now include an assertion for 'getCurrentPageSize()'.

  • Added Return Type for 'count' Method in CountableDataInterface File
    The count() method in the 'CountableDataInterface' now has an annotation to denote that it should return a non-negative integer. This enhances code clarity by specifying the expected behavior.

@vjik vjik marked this pull request as ready for review January 29, 2024 13:19
@vjik vjik added the status:code review The pull request needs review. label Jan 29, 2024
@vjik vjik requested a review from a team January 29, 2024 13:19
@vjik vjik merged commit b0352e0 into master Jan 30, 2024
@vjik vjik deleted the page-not-found branch January 30, 2024 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:code review The pull request needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants