| Total Complexity | 4 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class Config |
||
| 14 | { |
||
| 15 | // Default timeout for API call. |
||
| 16 | public const DEFAULT_TIMEOUT = 10; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Retrieve the Shodan API key. |
||
| 20 | * |
||
| 21 | * @return mixed|string|null The Google API key. |
||
| 22 | */ |
||
| 23 | public static function shodanApiKey() |
||
| 24 | { |
||
| 25 | $key = config('shodan.shodan.api_key'); |
||
| 26 | |||
| 27 | return !empty($key) ? $key : env('SHODAN_API_KEY'); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Retrieve set CURL timeout from config, in seconds. |
||
| 32 | * |
||
| 33 | * @return int CURL timeout. Default is 10. |
||
| 34 | */ |
||
| 35 | public static function curlTimeout(): int |
||
| 40 | } |
||
| 41 | } |
||
| 42 |