Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
romalytvynenko committed Mar 24, 2024
1 parent 14cb050 commit 1534a4b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ public function __construct(
) {
}

public function __invoke(GeneratorConfig $config)
public function __invoke(?GeneratorConfig $config = null)
{
$config ??= (new GeneratorConfig(config('scramble')))
->routes(Scramble::$routeResolver)
->afterOpenApiGenerated(Scramble::$openApiExtender);

$openApi = $this->makeOpenApi($config);

$this->getRoutes($config)
Expand Down Expand Up @@ -77,7 +81,7 @@ private function makeOpenApi(GeneratorConfig $config)
$openApi = OpenApi::make('3.1.0')
->setComponents($this->transformer->getComponents())
->setInfo(
InfoObject::make($config->get('ui.title', config('app.name')))
InfoObject::make($config->get('ui.title', $default = config('app.name')) ?: $default)
->setVersion($config->get('info.version', '0.0.1'))
->setDescription($config->get('info.description', ''))
);
Expand Down

0 comments on commit 1534a4b

Please sign in to comment.