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 null|ResponseInterface |
||
43 | */ |
||
44 | protected $lastResponse = null; |
||
45 | |||
46 | |||
47 | /** |
||
48 | * |
||
49 | * @param ClientInterface|null $client |
||
50 | */ |
||
51 | 6 | public function __construct(ClientInterface $client = null) { |
|
61 | |||
62 | |||
63 | /** |
||
64 | * @param string $url |
||
65 | * @return \Xparse\ElementFinder\ElementFinder |
||
66 | */ |
||
67 | 3 | public function get($url) { |
|
75 | |||
76 | |||
77 | /** |
||
78 | * @param string $url |
||
79 | * @param array $data |
||
80 | * @return \Xparse\ElementFinder\ElementFinder |
||
81 | */ |
||
82 | 2 | public function post($url, $data) { |
|
94 | |||
95 | |||
96 | /** |
||
97 | * @return \Xparse\ElementFinder\ElementFinder |
||
98 | */ |
||
99 | 2 | public function getLastPage() { |
|
102 | |||
103 | |||
104 | /** |
||
105 | * @param \Xparse\ElementFinder\ElementFinder $lastPage |
||
106 | * @return $this |
||
107 | */ |
||
108 | 3 | public function setLastPage($lastPage) { |
|
112 | |||
113 | |||
114 | /** |
||
115 | * @return null|ResponseInterface |
||
116 | */ |
||
117 | 1 | public function getLastResponse() { |
|
120 | |||
121 | |||
122 | /** |
||
123 | * @return ClientInterface |
||
124 | */ |
||
125 | 3 | public function getClient() { |
|
128 | |||
129 | |||
130 | /** |
||
131 | * |
||
132 | * @return boolean |
||
133 | */ |
||
134 | public function getConvertRelativeLinksState() { |
||
137 | |||
138 | |||
139 | /** |
||
140 | * @param boolean $convertRelativeLinksState |
||
141 | * @return $this |
||
142 | */ |
||
143 | public function setConvertRelativeLinksState($convertRelativeLinksState) { |
||
147 | |||
148 | |||
149 | /** |
||
150 | * @return boolean |
||
151 | */ |
||
152 | public function getConvertEncodingState() { |
||
155 | |||
156 | |||
157 | /** |
||
158 | * @param boolean $convertEncodingState |
||
159 | * @return $this |
||
160 | */ |
||
161 | public function setConvertEncodingState($convertEncodingState) { |
||
165 | |||
166 | |||
167 | /** |
||
168 | * @param $request |
||
169 | * @param array $options |
||
170 | * @return \Xparse\ElementFinder\ElementFinder |
||
171 | * @throws \Exception |
||
172 | */ |
||
173 | 3 | public function send(RequestInterface $request, $options = []) { |
|
209 | |||
210 | } |
||
211 |