1 | <?php |
||
19 | class Parser implements ParserInterface { |
||
20 | |||
21 | /** |
||
22 | * |
||
23 | * @var null|\Xparse\ElementFinder\ElementFinder |
||
24 | */ |
||
25 | protected $lastPage = null; |
||
26 | |||
27 | /** |
||
28 | * @var ClientInterface |
||
29 | */ |
||
30 | protected $client = null; |
||
31 | |||
32 | /** |
||
33 | * @var ElementFinderFactoryInterface |
||
34 | */ |
||
35 | protected $elementFinderFactory = null; |
||
36 | |||
37 | /** |
||
38 | * @var null|ResponseInterface |
||
39 | */ |
||
40 | protected $lastResponse = null; |
||
41 | |||
42 | |||
43 | /** |
||
44 | * @param ClientInterface|null $client |
||
45 | * @param ElementFinderFactoryInterface|null $elementFinderFactory |
||
46 | */ |
||
47 | 9 | 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 \Exception |
||
70 | * @throws \InvalidArgumentException |
||
71 | */ |
||
72 | 4 | public function get($url, array $options = []) { |
|
80 | |||
81 | |||
82 | /** |
||
83 | * @param string $url |
||
84 | * @param string|resource|\Psr\Http\Message\StreamInterface $body Message body. |
||
85 | * @param array $options |
||
86 | * @return ElementFinder |
||
87 | * @throws \Exception |
||
88 | * @throws \InvalidArgumentException |
||
89 | */ |
||
90 | 2 | public function post($url, $body = null, array $options = []) { |
|
100 | |||
101 | |||
102 | /** |
||
103 | * @return \Xparse\ElementFinder\ElementFinder |
||
104 | */ |
||
105 | 2 | public function getLastPage() { |
|
108 | |||
109 | |||
110 | /** |
||
111 | * @param \Xparse\ElementFinder\ElementFinder $lastPage |
||
112 | * @return $this |
||
113 | */ |
||
114 | 4 | public function setLastPage($lastPage) { |
|
118 | |||
119 | |||
120 | /** |
||
121 | * @return null|ResponseInterface |
||
122 | */ |
||
123 | 1 | public function getLastResponse() { |
|
126 | |||
127 | |||
128 | /** |
||
129 | * @return ClientInterface |
||
130 | */ |
||
131 | 4 | public function getClient() { |
|
134 | |||
135 | |||
136 | /** |
||
137 | * @param $request |
||
138 | * @param array $options |
||
139 | * @return \Xparse\ElementFinder\ElementFinder |
||
140 | * @throws \Exception |
||
141 | */ |
||
142 | 4 | public function send(RequestInterface $request, array $options = []) { |
|
168 | |||
169 | |||
170 | /** |
||
171 | * @return ElementFinderFactoryInterface |
||
172 | */ |
||
173 | 1 | public function getElementFinderFactory() { |
|
176 | |||
177 | } |
||
178 |