Skip to content

Commit 8c2451a

Browse files
authored
minor #1504 [make:stimulus-controller] use named arguments where possible
1 parent 2564804 commit 8c2451a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Maker/MakeStimulusController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public function configureCommand(Command $command, InputConfiguration $inputConf
5050
public function interact(InputInterface $input, ConsoleStyle $io, Command $command): void
5151
{
5252
$command->addArgument('extension', InputArgument::OPTIONAL);
53-
$command->addArgument('targets', InputArgument::OPTIONAL, '', []);
54-
$command->addArgument('values', InputArgument::OPTIONAL, '', []);
53+
$command->addArgument('targets', InputArgument::OPTIONAL);
54+
$command->addArgument('values', InputArgument::OPTIONAL);
5555

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

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

0 commit comments

Comments
 (0)