Skip to content

Commit

Permalink
Update method signatures in DrushStyle to match Symfony 6
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson committed Apr 1, 2022
1 parent dc51857 commit 5c320b6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Style/DrushStyle.php
Expand Up @@ -9,7 +9,7 @@

class DrushStyle extends SymfonyStyle
{
public function confirm($question, $default = true): bool
public function confirm(string $question, bool $default = true): bool
{
// Automatically accept confirmations if the --yes argument was supplied.
if (Drush::affirmative()) {
Expand All @@ -23,7 +23,7 @@ public function confirm($question, $default = true): bool
return parent::confirm($question, $default);
}

public function choice($question, array $choices, $default = null)
public function choice(string $question, array $choices, mixed $default = null): mixed
{
// Display the choices without their keys.
$choices_values = array_values($choices);
Expand All @@ -32,17 +32,17 @@ public function choice($question, array $choices, $default = null)
return array_search($return, $choices);
}

public function warning($message): void
public function warning(string|array $message)
{
$this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ! ', true);
}

public function note($message): void
public function note(string|array $message)
{
$this->block($message, 'NOTE', 'fg=black;bg=yellow', ' ! ');
}

public function caution($message): void
public function caution(string|array $message)
{
$this->block($message, 'CAUTION', 'fg=black;bg=yellow', ' ! ', true);
}
Expand Down

0 comments on commit 5c320b6

Please sign in to comment.