Skip to content

Commit

Permalink
minor #1504 [make:stimulus-controller] use named arguments where poss…
Browse files Browse the repository at this point in the history
…ible
  • Loading branch information
jrushlow committed Apr 5, 2024
1 parent 2564804 commit 8c2451a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Maker/MakeStimulusController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public function configureCommand(Command $command, InputConfiguration $inputConf
public function interact(InputInterface $input, ConsoleStyle $io, Command $command): void
{
$command->addArgument('extension', InputArgument::OPTIONAL);
$command->addArgument('targets', InputArgument::OPTIONAL, '', []);
$command->addArgument('values', InputArgument::OPTIONAL, '', []);
$command->addArgument('targets', InputArgument::OPTIONAL);
$command->addArgument('values', InputArgument::OPTIONAL);

$chosenExtension = $io->choice(
'Language (<fg=yellow>JavaScript</> or <fg=yellow>TypeScript</>)',
Expand Down Expand Up @@ -139,7 +139,7 @@ private function askForNextTarget(ConsoleStyle $io, array $targets, bool $isFirs
$questionText = 'Add another target? Enter the target name (or press <return> to stop adding targets)';
}

$targetName = $io->ask($questionText, null, function (?string $name) use ($targets) {
$targetName = $io->ask($questionText, validator: function (?string $name) use ($targets) {
if (\in_array($name, $targets)) {
throw new \InvalidArgumentException(sprintf('The "%s" target already exists.', $name));
}
Expand Down

0 comments on commit 8c2451a

Please sign in to comment.