1 | <?php |
||
18 | class Parser implements \Xparse\ParserInterface\ParserInterface { |
||
19 | |||
20 | /** |
||
21 | * Set true if we need to automatically convert relative links to absolute |
||
22 | */ |
||
23 | protected $convertRelativeLinksState = true; |
||
24 | |||
25 | /** |
||
26 | * Set true if we need automatically convert encoding to utf-8 |
||
27 | */ |
||
28 | protected $convertEncodingState = true; |
||
29 | |||
30 | /** |
||
31 | * |
||
32 | * @var null|\Xparse\ElementFinder\ElementFinder |
||
33 | */ |
||
34 | protected $lastPage = null; |
||
35 | |||
36 | /** |
||
37 | * @var ClientInterface |
||
38 | */ |
||
39 | protected $client = null; |
||
40 | |||
41 | /** |
||
42 | * @var ElementFinderFactory |
||
43 | */ |
||
44 | protected $elementFinderFactory = null; |
||
45 | |||
46 | /** |
||
47 | * @var null|ResponseInterface |
||
48 | */ |
||
49 | protected $lastResponse = null; |
||
50 | |||
51 | |||
52 | /** |
||
53 | * @param ClientInterface|null $client |
||
54 | * @param ElementFinderFactory|null $elementFinderFactory |
||
55 | */ |
||
56 | 6 | public function __construct(ClientInterface $client = null, ElementFinderFactory $elementFinderFactory = null) { |
|
71 | |||
72 | |||
73 | /** |
||
74 | * @param string $url |
||
75 | * @return \Xparse\ElementFinder\ElementFinder |
||
76 | * @throws \InvalidArgumentException |
||
77 | */ |
||
78 | 3 | public function get($url) { |
|
86 | |||
87 | |||
88 | /** |
||
89 | * @param string $url |
||
90 | * @param array $data |
||
91 | * @return \Xparse\ElementFinder\ElementFinder |
||
92 | * @throws \InvalidArgumentException |
||
93 | */ |
||
94 | 2 | public function post($url, $data) { |
|
106 | |||
107 | |||
108 | /** |
||
109 | * @return \Xparse\ElementFinder\ElementFinder |
||
110 | */ |
||
111 | 2 | public function getLastPage() { |
|
114 | |||
115 | |||
116 | /** |
||
117 | * @param \Xparse\ElementFinder\ElementFinder $lastPage |
||
118 | * @return $this |
||
119 | */ |
||
120 | 3 | public function setLastPage($lastPage) { |
|
124 | |||
125 | |||
126 | /** |
||
127 | * @return null|ResponseInterface |
||
128 | */ |
||
129 | 1 | public function getLastResponse() { |
|
132 | |||
133 | |||
134 | /** |
||
135 | * @return ClientInterface |
||
136 | */ |
||
137 | 3 | public function getClient() { |
|
140 | |||
141 | |||
142 | /** |
||
143 | * |
||
144 | * @return boolean |
||
145 | */ |
||
146 | public function getConvertRelativeLinksState() { |
||
149 | |||
150 | |||
151 | /** |
||
152 | * @param boolean $convertRelativeLinksState |
||
153 | * @return $this |
||
154 | */ |
||
155 | public function setConvertRelativeLinksState($convertRelativeLinksState) { |
||
159 | |||
160 | |||
161 | /** |
||
162 | * @return boolean |
||
163 | */ |
||
164 | public function getConvertEncodingState() { |
||
167 | |||
168 | |||
169 | /** |
||
170 | * @param boolean $convertEncodingState |
||
171 | * @return $this |
||
172 | */ |
||
173 | public function setConvertEncodingState($convertEncodingState) { |
||
177 | |||
178 | |||
179 | /** |
||
180 | * @param $request |
||
181 | * @param array $options |
||
182 | * @return \Xparse\ElementFinder\ElementFinder |
||
183 | * @throws \Exception |
||
184 | */ |
||
185 | 3 | public function send(RequestInterface $request, $options = []) { |
|
211 | |||
212 | } |
||
213 |