1 | <?php |
||
8 | class ShitarabaDriver extends AbstractDriver |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | protected $baseUrl = 'http://jbbs.shitaraba.net'; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $encoding = 'EUC-JP'; |
||
19 | |||
20 | /** |
||
21 | * get threads. |
||
22 | * |
||
23 | * @return \Illuminate\Support\Collection |
||
24 | * @throws MonarException |
||
25 | */ |
||
26 | public function threads() |
||
32 | |||
33 | /** |
||
34 | * get messages. |
||
35 | * |
||
36 | * @param int $start |
||
37 | * @param int $end |
||
38 | * |
||
39 | * @return \Illuminate\Support\Collection |
||
40 | * @throws MonarException |
||
41 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
42 | */ |
||
43 | public function messages($start = null, $end = null): Collection |
||
49 | |||
50 | /** |
||
51 | * post message. |
||
52 | * |
||
53 | * @param string $name |
||
54 | * @param string $email |
||
55 | * @param null $text |
||
56 | * |
||
57 | * @return mixed|string |
||
58 | * @throws MonarException |
||
59 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
60 | */ |
||
61 | public function post($name = '', $email = 'sage', $text = null) |
||
96 | |||
97 | /** |
||
98 | * parse url. |
||
99 | * |
||
100 | * @return void |
||
101 | */ |
||
102 | protected function parse(): void |
||
114 | |||
115 | /** |
||
116 | * parse dat collection. |
||
117 | * |
||
118 | * @param string $body |
||
119 | * |
||
120 | * @return \Illuminate\Support\Collection |
||
121 | */ |
||
122 | protected function parseDatCollection($body): Collection |
||
134 | |||
135 | /** |
||
136 | * parse threads collection. |
||
137 | * |
||
138 | * @param $body |
||
139 | * |
||
140 | * @return \Illuminate\Support\Collection |
||
141 | */ |
||
142 | protected function parseThreadsCollection($body): Collection |
||
163 | |||
164 | /** |
||
165 | * build message url. |
||
166 | * |
||
167 | * @param int $start |
||
168 | * @param int| null $end |
||
169 | * |
||
170 | * @return string |
||
171 | */ |
||
172 | protected function messagesUrl($start = 1, $end = null): string |
||
187 | |||
188 | /** |
||
189 | * build thread url. |
||
190 | * |
||
191 | * @return string |
||
192 | */ |
||
193 | protected function threadsUrl(): string |
||
197 | |||
198 | /** |
||
199 | * build post url. |
||
200 | * |
||
201 | * @return string |
||
202 | */ |
||
203 | protected function postUrl(): string |
||
207 | |||
208 | /** |
||
209 | * 書き込み確認かどうか. |
||
210 | * |
||
211 | * @param string $html |
||
212 | * |
||
213 | * @return bool |
||
214 | */ |
||
215 | private function confirm($html): bool |
||
219 | |||
220 | /** |
||
221 | * @param $html |
||
222 | * |
||
223 | * @return bool |
||
224 | */ |
||
225 | private function isError($html): bool |
||
229 | } |
||
230 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.