Add nbPages property to Page#92
Conversation
Pagerfanta exposes getNbPages() (the total number of pages), but Ray's Page only surfaced `total` (the result count), never the page count. Every consumer therefore had to recompute `ceil(total / maxPerPage)` by hand, duplicating logic that already lives in Pagerfanta. Add a public `$nbPages` property to Page and populate it from `Pagerfanta::getNbPages()` in both AuraSqlPager and AuraSqlQueryPager, so the page count is available alongside the existing total/maxPerPage fields without breaking the current API.
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #92 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 142 142
===========================================
Files 41 41
Lines 505 507 +2
===========================================
+ Hits 505 507 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
PagerfantaexposesgetNbPages()(the total number of pages), but Ray'sPageonly surfacestotal(the result count), never the page count. Every consumer therefore had to recomputeceil(total / maxPerPage)by hand, duplicating logic that already lives inPagerfanta.Changes
$nbPagesproperty toPage.Pagerfanta::getNbPages()in bothAuraSqlPagerandAuraSqlQueryPager, alongside the existingtotalassignment.Non-breaking: only an additive property on a final value object.
Verification
No files were checked); the change mirrors the existing property style.