|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
* Copyright (c) Ne-Lexa |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view |
|
9
|
|
|
* the LICENSE file that was distributed with this source code. |
|
10
|
|
|
* |
|
11
|
|
|
* @see https://github.com/Ne-Lexa/google-play-scraper |
|
12
|
|
|
*/ |
|
13
|
|
|
|
|
14
|
|
|
namespace Nelexa\GPlay\HttpClient; |
|
15
|
|
|
|
|
16
|
|
|
use Psr\Http\Message\RequestInterface; |
|
17
|
|
|
|
|
18
|
|
|
class Request |
|
19
|
|
|
{ |
|
20
|
|
|
/** @var \Psr\Http\Message\RequestInterface */ |
|
21
|
|
|
private $psrRequest; |
|
22
|
|
|
|
|
23
|
|
|
/** @var array */ |
|
24
|
|
|
private $options; |
|
25
|
|
|
|
|
26
|
|
|
/** @var \Closure<RequestInterface, \Psr\Http\Message\ResponseInterface, array>|callable<RequestInterface, \Psr\Http\Message\ResponseInterface, array>|ParseHandlerInterface */ |
|
27
|
|
|
private $parseHandler; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @param \Psr\Http\Message\RequestInterface $psrRequest |
|
31
|
|
|
* @param array $options |
|
32
|
|
|
* @param \Closure<RequestInterface, \Psr\Http\Message\ResponseInterface, array>|callable<RequestInterface, \Psr\Http\Message\ResponseInterface, array>|ParseHandlerInterface $parseHandler |
|
33
|
|
|
*/ |
|
34
|
63 |
|
public function __construct(RequestInterface $psrRequest, array $options, $parseHandler) |
|
35
|
|
|
{ |
|
36
|
63 |
|
$this->psrRequest = $psrRequest; |
|
37
|
63 |
|
$this->options = $options; |
|
38
|
63 |
|
$this->parseHandler = $parseHandler; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @return \Psr\Http\Message\RequestInterface |
|
43
|
|
|
*/ |
|
44
|
63 |
|
public function getPsrRequest(): RequestInterface |
|
45
|
|
|
{ |
|
46
|
63 |
|
return $this->psrRequest; |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* @return array |
|
51
|
|
|
*/ |
|
52
|
63 |
|
public function getOptions(): array |
|
53
|
|
|
{ |
|
54
|
63 |
|
return $this->options; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* @return \Closure<RequestInterface, \Psr\Http\Message\ResponseInterface, array>|callable<RequestInterface, \Psr\Http\Message\ResponseInterface, array>|ParseHandlerInterface |
|
59
|
|
|
*/ |
|
60
|
63 |
|
public function getParseHandler() |
|
61
|
|
|
{ |
|
62
|
63 |
|
return $this->parseHandler; |
|
63
|
|
|
} |
|
64
|
|
|
} |
|
65
|
|
|
|