| 1: | <?php declare(strict_types=1); | 
| 2: | |
| 3: | namespace Salient\Contract\Curler; | 
| 4: | |
| 5: | use Psr\Http\Message\RequestInterface as PsrRequestInterface; | 
| 6: | use OutOfRangeException; | 
| 7: | |
| 8: | /** | 
| 9: | * @api | 
| 10: | */ | 
| 11: | interface CurlerPageInterface | 
| 12: | { | 
| 13: | /** | 
| 14: | * Get a list of entities returned by the endpoint | 
| 15: | * | 
| 16: | * @return list<mixed> | 
| 17: | */ | 
| 18: | public function getEntities(): array; | 
| 19: | |
| 20: | /** | 
| 21: | * Check if more data can be requested from the endpoint | 
| 22: | */ | 
| 23: | public function hasNextRequest(): bool; | 
| 24: | |
| 25: | /** | 
| 26: | * Get a request to retrieve the next page of data from the endpoint | 
| 27: | * | 
| 28: | * Return a {@see CurlerPageRequestInterface} to propagate query changes to | 
| 29: | * the next {@see CurlerPagerInterface::getPage()} call in array form. | 
| 30: | * | 
| 31: | * @return CurlerPageRequestInterface|PsrRequestInterface | 
| 32: | * @throws OutOfRangeException if no more data can be requested. | 
| 33: | */ | 
| 34: | public function getNextRequest(); | 
| 35: | } | 
| 36: |