Skip to content

Commit fdeea9b

Browse files
author
Vignesh C
committed
null check added for the host method
1 parent a76132b commit fdeea9b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/GenerateSwaggerDoc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function handle()
3333
{
3434
$config = config('laravel-swagger');
3535

36-
$docs = (new Generator($config, $this->option('filter') ?: null, $this->option('auth') ?: null, $this->option('host') ?: null))->generate();
36+
$docs = (new Generator($config, $this->option('filter') ?: null, $this->option('auth') ?: null, !is_null($this->option('host')) ? $this->option('host') : null))->generate();
3737

3838
$formattedDocs = (new FormatterManager($docs))
3939
->setFormat($this->option('format'))

src/Generator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function getBaseInfo()
8282
'description' => $this->config['description'],
8383
'version' => $this->config['appVersion'],
8484
],
85-
'host' => !empty($this->host) ? $this->host : $this->config['host'],
85+
'host' => !is_null($this->host) ? $this->host : $this->config['host'],
8686
'basePath' => $this->config['basePath'],
8787
];
8888

0 commit comments

Comments
 (0)