Skip to content

Commit 2c26427

Browse files
Fix possible operator not supported for strings error (#639)
* Fix possible operator not supported for strings error * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot <bot@styleci.io>
1 parent 72cdcd7 commit 2c26427

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Generator.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@ protected function createScanFinder(): Finder
272272
protected function populateServers(): self
273273
{
274274
if ($this->basePath !== null && $this->openApi !== null) {
275+
if (
276+
$this->openApi->servers === OpenApiGenerator::UNDEFINED // @phpstan-ignore-line
277+
|| is_array($this->openApi->servers) === false // @phpstan-ignore-line
278+
) {
279+
$this->openApi->servers = [];
280+
}
281+
275282
$this->openApi->servers[] = new Server(['url' => $this->basePath]);
276283
}
277284

0 commit comments

Comments
 (0)