Skip to content

Commit 4dce5bb

Browse files
committed
fix: cast Artisan command options to proper types for PHPStan
1 parent 1cb083f commit 4dce5bb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Commands/BookStackExportCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public function handle(BookStackSync $bookstack): int
2525
$type = (string) $this->argument('type');
2626
$id = (int) $this->argument('id');
2727
$formatStr = (string) $this->option('format');
28-
$output = $this->option('output');
28+
$outputOption = $this->option('output');
29+
$output = is_string($outputOption) ? $outputOption : null;
2930

3031
// Validate type
3132
if (! in_array($type, ['book', 'chapter', 'page'], true)) {

src/Commands/BookStackSearchCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class BookStackSearchCommand extends Command
1818

1919
public function handle(BookStackSync $bookstack): int
2020
{
21-
$query = $this->argument('query');
21+
$query = (string) $this->argument('query');
2222
$limit = (int) $this->option('limit');
2323

2424
$this->info("Searching for: \"{$query}\"");

0 commit comments

Comments
 (0)