From 8c2451a4ab97cbd0606f7d471ef15936620664e7 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow <40327885+jrushlow@users.noreply.github.com> Date: Fri, 5 Apr 2024 10:12:26 -0400 Subject: [PATCH] minor #1504 [make:stimulus-controller] use named arguments where possible --- src/Maker/MakeStimulusController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Maker/MakeStimulusController.php b/src/Maker/MakeStimulusController.php index 4dd23e65e..dbb75ea36 100644 --- a/src/Maker/MakeStimulusController.php +++ b/src/Maker/MakeStimulusController.php @@ -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 (JavaScript or TypeScript)', @@ -139,7 +139,7 @@ private function askForNextTarget(ConsoleStyle $io, array $targets, bool $isFirs $questionText = 'Add another target? Enter the target name (or press 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)); }