@@ -91,6 +91,6 @@ |
||
91 | 91 | */ |
92 | 92 | protected static function inArguments($arguments, $shortArg, $longArg) |
93 | 93 | { |
94 | - return array_key_exists($shortArg, $arguments) || array_key_exists($longArg, $arguments); |
|
94 | + return array_key_exists($shortArg, $arguments) || array_key_exists($longArg, $arguments); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | \ No newline at end of file |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | // required at least one valid argument |
85 | 85 | self::validate( !empty($arguments), 'No valid arguments given. Run abuseipdb --help to get help.'); |
86 | 86 | |
87 | - // prints help ? |
|
88 | - if (self::inArguments($arguments, 'h', 'help')){ |
|
87 | + // prints help ? |
|
88 | + if (self::inArguments($arguments, 'h', 'help')){ |
|
89 | 89 | self::printBanner(); |
90 | 90 | self::printHelp(); |
91 | 91 | exit(0); |
@@ -188,10 +188,10 @@ discard block |
||
188 | 188 | * |
189 | 189 | * @access public |
190 | 190 | * @static |
191 | - * @param string $filePath The file's full path |
|
192 | - * @param bool $throwError Throw error on true or silent process. Default is true |
|
191 | + * @param string $filePath The file's full path |
|
192 | + * @param bool $throwError Throw error on true or silent process. Default is true |
|
193 | 193 | * |
194 | - * @return object|null |
|
194 | + * @return object|null |
|
195 | 195 | * @throws \Exception |
196 | 196 | * @throws \LogicException |
197 | 197 | */ |
@@ -199,10 +199,10 @@ discard block |
||
199 | 199 | { |
200 | 200 | // check file exists |
201 | 201 | if (!file_exists($filePath) || !is_file($filePath)){ |
202 | - if ($throwError) { |
|
202 | + if ($throwError) { |
|
203 | 203 | throw new \Exception('Config file not found'); |
204 | - } |
|
205 | - return null; |
|
204 | + } |
|
205 | + return null; |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | // get and parse content |
@@ -272,38 +272,38 @@ discard block |
||
272 | 272 | { |
273 | 273 | Console::log(' ' . Console::text('SYNOPSIS:', 'white', 'underline')); |
274 | 274 | Console::log(' ' . Console::text(' abuseipdb -C ') . |
275 | - Console::text('ip', 'yellow') . |
|
276 | - Console::text(' [-d ') . |
|
277 | - Console::text('days', 'yellow') . |
|
278 | - Console::text('] [-v] [-l ') . |
|
279 | - Console::text('limit', 'yellow') . |
|
280 | - Console::text(']')); |
|
275 | + Console::text('ip', 'yellow') . |
|
276 | + Console::text(' [-d ') . |
|
277 | + Console::text('days', 'yellow') . |
|
278 | + Console::text('] [-v] [-l ') . |
|
279 | + Console::text('limit', 'yellow') . |
|
280 | + Console::text(']')); |
|
281 | 281 | |
282 | 282 | Console::log(' ' . Console::text(' abuseipdb -K ') . |
283 | - Console::text('network', 'yellow') . |
|
284 | - Console::text(' [-d ') . |
|
285 | - Console::text('days', 'yellow') . |
|
286 | - Console::text(']')); |
|
283 | + Console::text('network', 'yellow') . |
|
284 | + Console::text(' [-d ') . |
|
285 | + Console::text('days', 'yellow') . |
|
286 | + Console::text(']')); |
|
287 | 287 | |
288 | 288 | Console::log(' ' . Console::text(' abuseipdb -R ' . |
289 | - Console::text('ip', 'yellow') . ' -c ' . |
|
290 | - Console::text('categories', 'yellow') . ' -m ' . |
|
291 | - Console::text('message', 'yellow'))); |
|
289 | + Console::text('ip', 'yellow') . ' -c ' . |
|
290 | + Console::text('categories', 'yellow') . ' -m ' . |
|
291 | + Console::text('message', 'yellow'))); |
|
292 | 292 | |
293 | 293 | Console::log(' ' . Console::text(' abuseipdb -V ' . |
294 | - Console::text('path', 'yellow'))); |
|
294 | + Console::text('path', 'yellow'))); |
|
295 | 295 | |
296 | 296 | Console::log(' ' . Console::text(' abuseipdb -E ' . |
297 | - Console::text('ip', 'yellow'))); |
|
297 | + Console::text('ip', 'yellow'))); |
|
298 | 298 | |
299 | 299 | Console::log(' ' . Console::text(' abuseipdb -B ') . |
300 | - Console::text('[-l ') . |
|
301 | - Console::text('limit', 'yellow') . |
|
302 | - Console::text('] [-s ') . |
|
303 | - Console::text('score', 'yellow') . |
|
304 | - Console::text('] [-p ') . |
|
305 | - Console::text('', 'yellow') . |
|
306 | - Console::text(']')); |
|
300 | + Console::text('[-l ') . |
|
301 | + Console::text('limit', 'yellow') . |
|
302 | + Console::text('] [-s ') . |
|
303 | + Console::text('score', 'yellow') . |
|
304 | + Console::text('] [-p ') . |
|
305 | + Console::text('', 'yellow') . |
|
306 | + Console::text(']')); |
|
307 | 307 | |
308 | 308 | Console::log(' ' . Console::text(' abuseipdb -L ')); |
309 | 309 | Console::log(' ' . Console::text(' abuseipdb -G ')); |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | |
860 | 860 | $line = Console::text(' →', $defaultColor); |
861 | 861 | $line .= self::printResult(' reported at: ', self::getDate($lastReport->reportedAt), $defaultColor, '', false); |
862 | - // $line .= self::printResult(' by user: ', $lastReport->reporterId, $defaultColor, '', false); |
|
862 | + // $line .= self::printResult(' by user: ', $lastReport->reporterId, $defaultColor, '', false); |
|
863 | 863 | if (isset($lastReport->reporterCountryCode) && isset($lastReport->reporterCountryName)){ |
864 | 864 | $line .= Console::text(' from: ', 'white'); |
865 | 865 | $line .= self::printResult('', $lastReport->reporterCountryCode, $defaultColor, '', false); |
@@ -269,20 +269,20 @@ |
||
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
272 | - * Get numeric parameter and exit on error |
|
273 | - * |
|
274 | - * @access protected |
|
275 | - * @static |
|
276 | - * @param array $arguments |
|
277 | - * @param string $shortArg The short argument name |
|
278 | - * @param string $longArg The long argument name |
|
279 | - * @param int $defaultValue |
|
280 | - * |
|
281 | - * @return int |
|
282 | - */ |
|
272 | + * Get numeric parameter and exit on error |
|
273 | + * |
|
274 | + * @access protected |
|
275 | + * @static |
|
276 | + * @param array $arguments |
|
277 | + * @param string $shortArg The short argument name |
|
278 | + * @param string $longArg The long argument name |
|
279 | + * @param int $defaultValue |
|
280 | + * |
|
281 | + * @return int |
|
282 | + */ |
|
283 | 283 | protected static function getNumericParameter(array $arguments, string $shortArg, string $longArg, int $defaultValue) |
284 | 284 | { |
285 | - if (self::inArguments($arguments,$shortArg, $longArg)){ |
|
285 | + if (self::inArguments($arguments,$shortArg, $longArg)){ |
|
286 | 286 | $val = self::getArgumentValue($arguments,$shortArg, $longArg); |
287 | 287 | |
288 | 288 | if (!is_numeric($val)){ |