Skip to content

Commit

Permalink
Isolate config require (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal authored Mar 18, 2024
1 parent 2b97072 commit 7d23d5b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Initializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ public function initConfiguration(
$this->printer->printLine('<gray>Using config</gray> ' . $configPath);

try {
$config = require $configPath;
$config = (static function () use ($configPath) {
return require $configPath;
})();
} catch (Throwable $e) {
throw new InvalidConfigException(get_class($e) . " in {$e->getFile()}:{$e->getLine()}\n > " . $e->getMessage(), 0, $e);
}
Expand Down

0 comments on commit 7d23d5b

Please sign in to comment.