Skip to content

Commit

Permalink
Extract a strongly typed helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Oct 29, 2023
1 parent c62224e commit 8f9d1dd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/framework/src/Console/Commands/MakePageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function validateOptions(): void
protected function getTitle(): string
{
return $this->argument('title')
?? $this->ask('What is the title of the page?')
?? $this->askForString('What is the title of the page?')
?? 'My New Page';
}

Expand Down Expand Up @@ -116,4 +116,9 @@ protected function getTypeOption(): ?string

return null;
}

protected function askForString(string $question, ?string $default = null): ?string
{
return $this->ask($question, $default);
}
}

0 comments on commit 8f9d1dd

Please sign in to comment.