diff --git a/src/Commands/ExportRequestDocsCommand.php b/src/Commands/ExportRequestDocsCommand.php index 9bef01f..8f20806 100644 --- a/src/Commands/ExportRequestDocsCommand.php +++ b/src/Commands/ExportRequestDocsCommand.php @@ -73,8 +73,8 @@ public function handle(): int // Loop and split Doc by the `methods` property. $docs = $this->laravelRequestDocs->splitByMethods($docs); - $docs = $this->laravelRequestDocs->sortDocs($docs, $this->option('sort') ?? 'default'); - $docs = $this->laravelRequestDocs->groupDocs($docs, $this->option('groupby') ?? 'default'); + $docs = $this->laravelRequestDocs->sortDocs($docs, is_string($this->option('sort')) ? $this->option('sort') : 'default'); + $docs = $this->laravelRequestDocs->groupDocs($docs, is_string($this->option('groupby')) ? $this->option('groupby') : 'default'); if (!$this->writeApiDocsToFile($docs)) { throw new ErrorException("Failed to write on [{$this->exportFilePath}] file.");