Skip to content

Commit 68ce512

Browse files
committed
Fix PHPStan: handle option return type properly
1 parent cda5d2e commit 68ce512

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/InitDtoCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class InitDtoCommand extends Command
2222

2323
public function handle(): int
2424
{
25-
$format = strtolower((string)$this->option('format'));
25+
$formatOption = $this->option('format');
26+
$format = is_string($formatOption) ? strtolower($formatOption) : 'php';
2627
$configPath = config('dto.config_path', config_path());
2728

2829
if (!in_array($format, ['php', 'xml', 'yaml', 'yml'], true)) {

0 commit comments

Comments
 (0)