1: <?php declare(strict_types=1);
2:
3: namespace Salient\Curler;
4:
5: use Psr\Http\Message\RequestInterface;
6: use Salient\Contract\Curler\CurlerPageRequestInterface;
7:
8: /**
9: * A request for a page of data from an HTTP endpoint
10: *
11: * @api
12: */
13: class CurlerPageRequest implements CurlerPageRequestInterface
14: {
15: protected RequestInterface $NextRequest;
16: /** @var mixed[]|null */
17: protected ?array $NextQuery;
18:
19: /**
20: * Creates a new CurlerPageRequest object
21: *
22: * @param mixed[]|null $nextQuery
23: */
24: public function __construct(
25: RequestInterface $nextRequest,
26: ?array $nextQuery = null
27: ) {
28: $this->NextRequest = $nextRequest;
29: $this->NextQuery = $nextQuery;
30: }
31:
32: /**
33: * @inheritDoc
34: */
35: public function getRequest(): RequestInterface
36: {
37: return $this->NextRequest;
38: }
39:
40: /**
41: * @inheritDoc
42: */
43: public function getQuery(): ?array
44: {
45: return $this->NextQuery;
46: }
47: }
48: