@@ -2,9 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Integrations\Connectors\Tumblr; |
4 | 4 | |
5 | -use Log; |
|
6 | -use App\Models\User; |
|
7 | - |
|
8 | 5 | class Post extends Tumblr |
9 | 6 | { |
10 | 7 |
@@ -2,9 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Integrations\Connectors\Tumblr; |
4 | 4 | |
5 | -use Log; |
|
6 | -use App\Models\User; |
|
7 | - |
|
8 | 5 | class Relation extends Tumblr |
9 | 6 | { |
10 | 7 |
@@ -52,7 +52,7 @@ |
||
52 | 52 | /** |
53 | 53 | * Parses the API Reply |
54 | 54 | * |
55 | - * @param mixed $jsonreply |
|
55 | + * @param string $jsonreply |
|
56 | 56 | * |
57 | 57 | * @return mixed |
58 | 58 | */ |
@@ -2,9 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Integrations\Connectors\Twitter; |
4 | 4 | |
5 | -use Log; |
|
6 | -use App\Models\User; |
|
7 | - |
|
8 | 5 | class DatumboxAPI |
9 | 6 | { |
10 | 7 | const version='1.0'; |
@@ -201,6 +201,12 @@ discard block |
||
201 | 201 | // (1) do a lookup in a table of trusted certs keyed off of consumer |
202 | 202 | // |
203 | 203 | // Either way should return a string representation of the certificate |
204 | + |
|
205 | + /** |
|
206 | + * @param OAuthRequest $request |
|
207 | + * |
|
208 | + * @return string |
|
209 | + */ |
|
204 | 210 | protected abstract function fetch_private_cert(&$request); |
205 | 211 | |
206 | 212 | public function build_signature($request, $consumer, $token) |
@@ -338,6 +344,9 @@ discard block |
||
338 | 344 | return new OAuthRequest($http_method, $http_url, $parameters); |
339 | 345 | } |
340 | 346 | |
347 | + /** |
|
348 | + * @param string $name |
|
349 | + */ |
|
341 | 350 | public function set_parameter($name, $value, $allow_duplicates = true) |
342 | 351 | { |
343 | 352 | if ($allow_duplicates && isset($this->parameters[$name])) { |
@@ -6,8 +6,6 @@ |
||
6 | 6 | |
7 | 7 | namespace Integrations\Connectors\Twitter; |
8 | 8 | |
9 | -use Log; |
|
10 | -use App\Models\User; |
|
11 | 9 | use Abraham\TwitterOAuth\TwitterOAuth; |
12 | 10 | |
13 | 11 | use Integrations\Connectors\Connector; |
@@ -119,6 +119,8 @@ discard block |
||
119 | 119 | * @param string consumer secret |
120 | 120 | * @param string access token |
121 | 121 | * @param string access token secret |
122 | + * @param string $consumer_key |
|
123 | + * @param string $consumer_secret |
|
122 | 124 | * @return TwitterApiClient |
123 | 125 | */ |
124 | 126 | public function set_oauth( $consumer_key, $consumer_secret, $access_key = '', $access_secret = '' ) |
@@ -225,6 +227,7 @@ discard block |
||
225 | 227 | * @param string API method, e.g. "users/show" |
226 | 228 | * @param array method arguments |
227 | 229 | * @param string http request method |
230 | + * @param string $path |
|
228 | 231 | * @return array unserialized data returned from Twitter |
229 | 232 | * @throws TwitterApiException |
230 | 233 | */ |
@@ -290,6 +293,7 @@ discard block |
||
290 | 293 | * Perform an OAuth request - these differ somewhat from regular API calls |
291 | 294 | * |
292 | 295 | * @internal |
296 | + * @param string $endpoint |
|
293 | 297 | */ |
294 | 298 | private function oauth_exchange( $endpoint, array $args ) |
295 | 299 | { |
@@ -327,6 +331,7 @@ discard block |
||
327 | 331 | /** |
328 | 332 | * Sign and execute REST API call |
329 | 333 | * |
334 | + * @param string $http_method |
|
330 | 335 | * @return array |
331 | 336 | */ |
332 | 337 | private function rest_request( $path, array $args, $http_method ) |
@@ -669,6 +674,7 @@ discard block |
||
669 | 674 | * Construct TwitterApiException with addition of HTTP status code. |
670 | 675 | * |
671 | 676 | * @overload |
677 | + * @param string $message |
|
672 | 678 | */ |
673 | 679 | public function __construct( $message, $code = 0 ) |
674 | 680 | { |
@@ -199,6 +199,7 @@ discard block |
||
199 | 199 | |
200 | 200 | /** |
201 | 201 | * Format and sign an OAuth / API request |
202 | + * @param string $method |
|
202 | 203 | */ |
203 | 204 | function oAuthRequest($url, $method, $parameters) |
204 | 205 | { |
@@ -218,6 +219,7 @@ discard block |
||
218 | 219 | /** |
219 | 220 | * Make an HTTP request |
220 | 221 | * |
222 | + * @param string $postfields |
|
221 | 223 | * @return API results |
222 | 224 | */ |
223 | 225 | function http($url, $method, $postfields = null) |
@@ -2,9 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Integrations\Connectors\Twitter; |
4 | 4 | |
5 | -use Log; |
|
6 | -use App\Models\User; |
|
7 | - |
|
8 | 5 | class TwitterSentimentAnalysis extends Twitter |
9 | 6 | { |
10 | 7 |
@@ -174,6 +174,10 @@ discard block |
||
174 | 174 | } |
175 | 175 | return $links; |
176 | 176 | } |
177 | + |
|
178 | + /** |
|
179 | + * @param string $found_link |
|
180 | + */ |
|
177 | 181 | private function bad_link_check($found_link) |
178 | 182 | { |
179 | 183 | $bad = [':', 'http', '\\', '<', '#']; |
@@ -187,6 +191,10 @@ discard block |
||
187 | 191 | } |
188 | 192 | return $is_bad; |
189 | 193 | } |
194 | + |
|
195 | + /** |
|
196 | + * @return string |
|
197 | + */ |
|
190 | 198 | private function fix_link($link) |
191 | 199 | { |
192 | 200 | if(strpos($link, "|") !== false) { |
@@ -222,6 +230,10 @@ discard block |
||
222 | 230 | } |
223 | 231 | return $quotes; |
224 | 232 | } |
233 | + |
|
234 | + /** |
|
235 | + * @param string $url |
|
236 | + */ |
|
225 | 237 | private function get_redirect_url($url) |
226 | 238 | { |
227 | 239 | $r = array('http' => array('method' => 'HEAD')); |
@@ -309,6 +321,10 @@ discard block |
||
309 | 321 | } |
310 | 322 | return $article; |
311 | 323 | } |
324 | + |
|
325 | + /** |
|
326 | + * @param string $notice |
|
327 | + */ |
|
312 | 328 | private function show_error($notice) |
313 | 329 | { |
314 | 330 | echo json_encode([$notice]); |