| Conditions | 6 |
| Paths | 9 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | public static function canInitFromConfig(): bool |
||
| 30 | { |
||
| 31 | if (!function_exists('config')) { |
||
| 32 | return false; |
||
| 33 | } |
||
| 34 | |||
| 35 | $container = function_exists('app') ? app() : Container::getInstance(); |
||
| 36 | if (!$container->has('config')) { |
||
| 37 | return false; |
||
| 38 | } |
||
| 39 | |||
| 40 | $config = config(); |
||
| 41 | if ($config->has('recaptcha')) { |
||
| 42 | static::$configRoot = 'recaptcha'; |
||
| 43 | return true; |
||
| 44 | } |
||
| 45 | if ($config->has('services.recaptcha')) { |
||
| 46 | static::$configRoot = 'services.recaptcha'; |
||
| 47 | return true; |
||
| 48 | } |
||
| 49 | return false; |
||
| 50 | } |
||
| 70 |