From 8b8a2ea89eabdc491ab0993e2085a81c02123dd4 Mon Sep 17 00:00:00 2001 From: Kit Loong Date: Thu, 27 Jun 2024 19:59:59 +0800 Subject: [PATCH] String check --- src/Commands/ExportRequestDocsCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.");