1 | <?php |
||
19 | class Parser implements ParserInterface { |
||
20 | |||
21 | /** |
||
22 | * |
||
23 | * @var ElementFinder|null |
||
24 | */ |
||
25 | protected $lastPage; |
||
26 | |||
27 | /** |
||
28 | * @var ClientInterface |
||
29 | */ |
||
30 | protected $client; |
||
31 | |||
32 | /** |
||
33 | * @var ElementFinderFactoryInterface |
||
34 | */ |
||
35 | protected $elementFinderFactory; |
||
36 | |||
37 | /** |
||
38 | * @var null|ResponseInterface |
||
39 | */ |
||
40 | protected $lastResponse; |
||
41 | |||
42 | |||
43 | /** |
||
44 | * @param ClientInterface|null $client |
||
45 | * @param ElementFinderFactoryInterface|null $elementFinderFactory |
||
46 | */ |
||
47 | 10 | public function __construct(ClientInterface $client = null, ElementFinderFactoryInterface $elementFinderFactory = null) { |
|
63 | |||
64 | |||
65 | /** |
||
66 | * @param string $url |
||
67 | * @param array $options |
||
68 | * @return ElementFinder |
||
69 | * @throws \InvalidArgumentException |
||
70 | */ |
||
71 | public function get(string $url, array $options = []): ElementFinder { |
||
80 | |||
81 | |||
82 | /** |
||
83 | * @param string $url |
||
84 | * @param array $options |
||
85 | * @return ElementFinder |
||
86 | * @throws \InvalidArgumentException |
||
87 | */ |
||
88 | public function post(string $url, array $options = []): ElementFinder { |
||
97 | |||
98 | 1 | ||
99 | /** |
||
100 | * @return ElementFinder|null |
||
101 | */ |
||
102 | public function getLastPage() { |
||
105 | 2 | ||
106 | 2 | ||
107 | |||
108 | /** |
||
109 | * @return null|ResponseInterface |
||
110 | */ |
||
111 | public function getLastResponse() { |
||
114 | 5 | ||
115 | 5 | ||
116 | 5 | /** |
|
117 | * @return ClientInterface |
||
118 | */ |
||
119 | public function getClient(): ClientInterface { |
||
122 | |||
123 | 2 | ||
124 | 2 | /** |
|
125 | * @param RequestInterface $request |
||
126 | * @param array $options |
||
127 | * @return ElementFinder |
||
128 | */ |
||
129 | public function send(RequestInterface $request, array $options = []): ElementFinder { |
||
155 | 5 | ||
156 | |||
157 | 5 | /** |
|
158 | 5 | * @return ElementFinderFactoryInterface |
|
159 | 1 | */ |
|
160 | 1 | public function getElementFinderFactory(): ElementFinderFactoryInterface { |
|
163 | |||
164 | } |
||
165 |