Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
- Bug #195: Fix invalid count in `IterableDataReader` when limit or/and offset used (@vjik)
- Enh #201: Disable sorting when limit is set explicitly in a paginator (@samdark)
- Enh #202: Check that correct sort is passed to `withSort()` of keyset paginator (@samdark)
- Enh #207: More specific Psalm type for `OffsetPaginator::withCurrentPage()` (@samdark)
- Enh #214: Improved interface hierarchy (@samdark)
- Enh #207: More specific Psalm type for `OffsetPaginator::withCurrentPage()` parameter (@samdark)
- Enh #210: More specific Psalm type for `PaginatorInterface::getPageSize()` result (@vjik)

Expand Down
2 changes: 1 addition & 1 deletion src/Paginator/OffsetPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ final class OffsetPaginator implements PaginatorInterface
/**
* Data reader being paginated.
*
* @psalm-var ReadableDataInterface<TKey, TValue>&LimitableDataInterface&OffsetableDataInterface&CountableDataInterface
* @psalm-var ReadableDataInterface<TKey, TValue>&LimitableDataInterface<TKey, TValue>&OffsetableDataInterface<TKey, TValue>&CountableDataInterface
*/
private ReadableDataInterface $dataReader;

Expand Down
6 changes: 4 additions & 2 deletions src/Reader/DataReaderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
* @template TKey as array-key
* @template TValue as array|object
*
* @extends ReadableDataInterface<TKey, TValue>
* @extends LimitableDataInterface<TKey, TValue>
* @extends OffsetableDataInterface<TKey, TValue>
* @extends SortableDataInterface<TKey, TValue>
* @extends FilterableDataInterface<TKey, TValue>
* @extends IteratorAggregate<TKey, TValue>
*/
interface DataReaderInterface extends
ReadableDataInterface,
LimitableDataInterface,
OffsetableDataInterface,
CountableDataInterface,
Expand Down
7 changes: 6 additions & 1 deletion src/Reader/FilterableDataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@
* {@see FilterInterface::getOperator()} is applied
*
* For performance reasons, prefer filtering as many items as possible in the first step.
*
* @template TKey as array-key
* @template TValue as array|object
*
* @extends ReadableDataInterface<TKey, TValue>
*/
interface FilterableDataInterface
interface FilterableDataInterface extends ReadableDataInterface
{
/**
* Returns new instance with data reading criteria set.
Expand Down
7 changes: 6 additions & 1 deletion src/Reader/LimitableDataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@

/**
* Data that could be limited.
*
* @template TKey as array-key
* @template TValue as array|object
*
* @extends ReadableDataInterface<TKey, TValue>
*/
interface LimitableDataInterface
interface LimitableDataInterface extends ReadableDataInterface
{
/**
* Get a new instance with the limit set.
Expand Down
7 changes: 6 additions & 1 deletion src/Reader/OffsetableDataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@

/**
* Data that could be read from Nth item by skipping items from the beginning.
*
* @template TKey as array-key
* @template TValue as array|object
*
* @extends ReadableDataInterface<TKey, TValue>
*/
interface OffsetableDataInterface
interface OffsetableDataInterface extends ReadableDataInterface
{
/**
* Get a new instance with an offset set.
Expand Down
7 changes: 6 additions & 1 deletion src/Reader/SortableDataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
/**
* A data set that could be sorted.
* The sorting set may be used by a data reader that supports sorting.
*
* @template TKey as array-key
* @template TValue as array|object
*
* @extends ReadableDataInterface<TKey, TValue>
*/
interface SortableDataInterface
interface SortableDataInterface extends ReadableDataInterface
{
/**
* Get a new instance with a sorting set.
Expand Down