| Total Complexity | 8 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class InvalidConfigurationException extends InvalidArgumentException |
||
| 16 | { |
||
| 17 | public function __construct(string $message = 'Invalid configuration detected.', ?string $namespace = null, ?string $key = null, ?Throwable $previous = null) |
||
| 18 | { |
||
| 19 | if ($namespace && $key) { |
||
| 20 | [$this->file, $this->line] = $this->findConfigLine($namespace, $key); |
||
| 21 | } |
||
| 22 | |||
| 23 | parent::__construct($message, previous: $previous); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @experimental Please report any issues with this method to the authors at https://github.com/hydephp/develop/issues |
||
| 28 | * |
||
| 29 | * @return array{string, int} |
||
|
|
|||
| 30 | */ |
||
| 31 | protected function findConfigLine(string $namespace, string $key): array |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @internal |
||
| 51 | */ |
||
| 52 | public static function try(callable $callback, ?string $message = null): mixed |
||
| 61 |