Conversation
…asy page-by-page reading Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
|
@copilot please fix static analysis errors. |
…plementations Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
Fixed the static analysis errors. Added PHPDoc type annotations to help Psalm understand that the return type from Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot remove psalm.phar, use one from vendor/bin instead. |
…stead Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
Removed psalm.phar and added it to .gitignore to use vendor/bin/psalm instead. The project now relies on the composer-installed psalm from the dev dependencies. Commit: 696cc7e Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
nextPage() and previousPage() methods to enable easy page-by-page data reading
Added documentation for the new Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…review feedback Co-authored-by: Tigrov <8563175+Tigrov@users.noreply.github.com>
Overview
This PR implements the feature requested in #213 to provide an easy way to read data page by page. The solution adds a
nextPage()method to both paginator implementations that returns a data reader for the next page, enabling intuitive iterative pagination.API Usage
The new API enables the following clean iteration pattern:
Implementation Details
Core Changes
PaginatorInterface: Added
nextPage(): ?ReadableDataInterfacemethod to ensure consistent API across all paginator implementations.KeysetPaginator: Implemented
nextPage()that leverages existing token-based navigation:nullwhen on the last page (enables natural loop termination)OffsetPaginator: Implemented
nextPage()with the same behavior for consistency across paginator types.Method Naming
The method is named
nextPage()following @samdark's suggestion in the issue comments, rather than the originally proposednextDataReader().Key Features
nullwhen no next page exists, enabling naturalwhileloop patternsTesting
Added comprehensive test coverage for both paginator implementations covering:
Breaking Changes
None. This is a purely additive change that doesn't modify any existing behavior.
Fixes #213
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/OndraM/ci-detector/zipball/8b0223b5ed235fd377c75fdd1bfcad05c0f168b8/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/clue/reactphp-term/zipball/00f297dc597eaee2ebf98af8f27cca5d21d60fa3/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/clue/reactphp-utf8/zipball/d5cd04d39cb5457aa5df830b7c4b301d2694217e/usr/bin/php8.3 -n -c /tmp/6IiDrR /usr/bin/composer install(http block)/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/colinodell/json5/zipball/15b063f8cb5e6deb15f0cd39123264ec0d19c710/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/infection/abstract-testframework-adapter/zipball/18925e20d15d1a5995bb85c9dc09e8751e1e069b/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/infection/extension-installer/zipball/9b351d2910b9a23ab4815542e93d541e0ca0cdcf/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/infection/include-interceptor/zipball/0cc76d95a79d9832d74e74492b0a30139904bdf7/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/jolicode/php-os-helper/zipball/1622ad8bbcab98e62b5c041397e8519f10d90e29/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/jsonrainbow/json-schema/zipball/feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/maglnet/ComposerRequireChecker/zipball/5109aed7b4695e6d772c4e748030c92da69a7f81/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/92dde6a5919e34835c506ac8c523ef095a95ed62/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phpstan/phpdoc-parser/zipball/b9e61a61e39e02dd90944e9115241c7f7e76bfd8/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/console/zipball/9e27aecde8f506ba0fd1d9989620c04a87697101/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/string/zipball/f3570b8c61ca887a9e2938e85cb6458515d2b125/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/webmozarts/glob/zipball/8a2842112d6916e61e0e15e316465b611f3abc17/usr/bin/php8.3 -n -c /tmp/iK4Uni /usr/bin/composer install --no-interaction(http block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.