@@ -80,8 +80,8 @@ discard block |
||
| 80 | 80 | 'userId' => $this->aipdbUserId, |
| 81 | 81 | 'apiKey' => $this->aipdbApiKey, |
| 82 | 82 | |
| 83 | - // TODO 'selfIps' => $this->selfIps, |
|
| 84 | - // TODO default report cat |
|
| 83 | + // TODO 'selfIps' => $this->selfIps, |
|
| 84 | + // TODO default report cat |
|
| 85 | 85 | ); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | public function report(string $ip = '', string $categories = '', string $message = '', bool $returnArray = false) |
| 152 | 152 | { |
| 153 | - // ip must be set |
|
| 153 | + // ip must be set |
|
| 154 | 154 | if (empty($ip)){ |
| 155 | 155 | throw new \InvalidArgumentException('Ip was empty'); |
| 156 | 156 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | // message must be set |
| 164 | - if (empty($message)){ |
|
| 164 | + if (empty($message)){ |
|
| 165 | 165 | throw new \InvalidArgumentException('report message was empty'); |
| 166 | 166 | } |
| 167 | 167 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | // option |
| 279 | 279 | if ($verbose){ |
| 280 | - $data['verbose'] = true; |
|
| 280 | + $data['verbose'] = true; |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | // check AbuseIPDB request |
@@ -321,14 +321,14 @@ discard block |
||
| 321 | 321 | 'Key: ' . $this->aipdbApiKey, |
| 322 | 322 | ]); |
| 323 | 323 | |
| 324 | - // execute curl call |
|
| 325 | - $result = curl_exec($ch); |
|
| 324 | + // execute curl call |
|
| 325 | + $result = curl_exec($ch); |
|
| 326 | 326 | |
| 327 | - // close connection |
|
| 328 | - curl_close($ch); |
|
| 327 | + // close connection |
|
| 328 | + curl_close($ch); |
|
| 329 | 329 | |
| 330 | - // return response as object / array |
|
| 331 | - return json_decode($result, $returnArray); |
|
| 330 | + // return response as object / array |
|
| 331 | + return json_decode($result, $returnArray); |
|
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | /** |
@@ -336,10 +336,10 @@ discard block |
||
| 336 | 336 | * |
| 337 | 337 | * @access public |
| 338 | 338 | * @static |
| 339 | - * @param string $filePath The file's full path |
|
| 340 | - * @param bool [$trowError] Throw error on true or silent process. Default is true |
|
| 339 | + * @param string $filePath The file's full path |
|
| 340 | + * @param bool [$trowError] Throw error on true or silent process. Default is true |
|
| 341 | 341 | * |
| 342 | - * @return string|null |
|
| 342 | + * @return string|null |
|
| 343 | 343 | * @throws \Exception |
| 344 | 344 | * @throws \LogicException |
| 345 | 345 | */ |
@@ -347,10 +347,10 @@ discard block |
||
| 347 | 347 | { |
| 348 | 348 | // check file exists |
| 349 | 349 | if (!file_exists($filePath) || !is_file($filePath)){ |
| 350 | - if ($throwError) { |
|
| 350 | + if ($throwError) { |
|
| 351 | 351 | throw new \Exception('Config file not found'); |
| 352 | - } |
|
| 353 | - return null; |
|
| 352 | + } |
|
| 353 | + return null; |
|
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | // get and parse content |
@@ -28,10 +28,10 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | abstract class ApiDefintion |
| 30 | 30 | { |
| 31 | - /** |
|
| 32 | - * AbuseIPDB API v2 Endpoint |
|
| 33 | - * @var string $api_endpoint |
|
| 34 | - */ |
|
| 31 | + /** |
|
| 32 | + * AbuseIPDB API v2 Endpoint |
|
| 33 | + * @var string $api_endpoint |
|
| 34 | + */ |
|
| 35 | 35 | protected $aipdbApiEndpoint = 'https://api.abuseipdb.com/api/v2/'; |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | // Open proxy, open relay, or Tor exit node. |
| 68 | 68 | ['openproxy' , '9', 'Open Proxy', true], |
| 69 | 69 | |
| 70 | - // Comment/forum spam, HTTP referer spam, or other CMS spam. |
|
| 71 | - ['webspam' , '10', 'Web Spam', true], |
|
| 70 | + // Comment/forum spam, HTTP referer spam, or other CMS spam. |
|
| 71 | + ['webspam' , '10', 'Web Spam', true], |
|
| 72 | 72 | |
| 73 | 73 | // Spam email content, infected attachments, and phishing emails. Note: Limit comments to only relevent |
| 74 | 74 | // information (instead of log dumps) and be sure to remove PII if you want to remain anonymous. |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | // Abuse was targeted at an "Internet of Things" type device. Include |
| 118 | 118 | // information about what type of device was targeted in the comments. |
| 119 | 119 | ['oit' , '23', 'IoT Targeted', true], |
| 120 | - ]; |
|
| 120 | + ]; |
|
| 121 | 121 | |
| 122 | 122 | /** |
| 123 | 123 | * Get the category id corresponding to given name |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | if ($cat[0] === $categoryName) { |
| 134 | 134 | return $cat; |
| 135 | 135 | } |
| 136 | - } |
|
| 136 | + } |
|
| 137 | 137 | |
| 138 | 138 | // not found |
| 139 | 139 | return false; |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | protected function getCategoryNameById(string $categoryId) |
| 151 | 151 | { |
| 152 | 152 | foreach ($this->aipdbApiCategories as $cat){ |
| 153 | - if ($cat[1] === $categoryId) { |
|
| 154 | - return $cat; |
|
| 155 | - } |
|
| 153 | + if ($cat[1] === $categoryId) { |
|
| 154 | + return $cat; |
|
| 155 | + } |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | // not found |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | if ($cat[$index] === $value) { |
| 179 | 179 | return $i; |
| 180 | 180 | } |
| 181 | - } |
|
| 181 | + } |
|
| 182 | 182 | |
| 183 | 183 | // not found |
| 184 | 184 | return false; |