PHPackages                             componenta/paginator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. componenta/paginator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

componenta/paginator
====================

Paginator contract and immutable paginator implementation

v1.0.0(1mo ago)083MITPHPPHP ^8.4

Since Jun 16Pushed 1mo agoCompare

[ Source](https://github.com/componenta/paginator)[ Packagist](https://packagist.org/packages/componenta/paginator)[ RSS](/packages/componenta-paginator/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (3)

Componenta Paginator
====================

[](#componenta-paginator)

Offset-based paginator value object with array conversion.

Use it for read models and list endpoints that return a slice of results together with navigation metadata.

Installation
------------

[](#installation)

```
composer require componenta/paginator
```

Related Packages
----------------

[](#related-packages)

PackageWhy it matters here`componenta/arrayable``PaginatorInterface` extends `Arrayable`.`componenta/http-responder`Responders can serialize pagination results as JSON.`componenta/cycle``DataFetcher` can return paginated read-side results.`componenta/cqrs`Query handlers commonly return `Paginator` from read scenarios.Usage
-----

[](#usage)

```
use Componenta\Stdlib\Paginator;

$page = new Paginator(
    results: $posts,
    limit: 20,
    offset: 40,
    totalCount: 95,
);

$page->currentPage; // 3
$page->totalPages;  // 5
$page->hasNextPage; // true
$page->nextOffset;  // 60
```

`Paginator` implements `PaginatorInterface`, which extends `Componenta\Arrayable\Arrayable`.

Array Shape
-----------

[](#array-shape)

`toArray()` returns:

- `results`
- `totalCount`
- `limit`
- `offset`
- `currentPage`
- `totalPages`
- `hasNext`
- `hasPrev`
- `range`

`range` is `null` for an empty page. Otherwise it contains one-based result positions for the current slice.

Unknown Totals
--------------

[](#unknown-totals)

`totalCount` may be `null` for infinite-scroll reads. In that mode:

- `totalPages` is `null`
- `hasNextPage` uses `hasNextPageHint` when provided
- without a hint, `hasNextPage` falls back to `count(results) >= limit`

Fetchers can request one extra row, trim it, and pass an explicit hint for precise next-page detection without running a total-count query.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance91

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

43d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20490712?v=4)[Andrey Shelamkoff](/maintainers/Shelamkoff)[@Shelamkoff](https://github.com/Shelamkoff)

---

Top Contributors

[![Shelamkoff](https://avatars.githubusercontent.com/u/20490712?v=4)](https://github.com/Shelamkoff "Shelamkoff (1 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/componenta-paginator/health.svg)

```
[![Health](https://phpackages.com/badges/componenta-paginator/health.svg)](https://phpackages.com/packages/componenta-paginator)
```

###  Alternatives

[hughgrigg/php-business-time

Business time / working days extension for Carbon dates

3330.5k](/packages/hughgrigg-php-business-time)[tu6ge/voyager-excel

voyager excel export hook

215.0k](/packages/tu6ge-voyager-excel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
