Total Complexity | 4 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
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 | 5 | public static function shodanApiKey() |
|
24 | { |
||
25 | 5 | $key = config('shodan.shodan.api_key'); |
|
26 | |||
27 | 5 | return !empty($key) ? $key : null; |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * Retrieve set CURL timeout from config, in seconds. |
||
32 | * |
||
33 | * @return int CURL timeout. Default is 10. |
||
34 | */ |
||
35 | 1 | public static function curlTimeout(): int |
|
40 | } |
||
41 | } |
||
42 |