Conditions | 5 |
Paths | 6 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
44 | private function loadConfigFile(array $paths) |
||
45 | { |
||
46 | foreach ($paths as $path) { |
||
47 | if (file_exists($path)) { |
||
48 | if ($this->logger) { |
||
49 | $this->logger->info("The file is found on: $path"); |
||
50 | } |
||
51 | return require $path; |
||
52 | } |
||
53 | } |
||
54 | |||
55 | |||
56 | $message = 'The file viva-config.php was not found in any of the specified paths.'; |
||
57 | |||
58 | if ($this->logger) { |
||
59 | $this->logger->error($message, ['paths' => $paths]); |
||
60 | } |
||
61 | throw new \RuntimeException($message); |
||
62 | } |
||
64 |