Skip to content

Commit

Permalink
fix(maker): Fix icon argument usage in UiElementMaker
Browse files Browse the repository at this point in the history
  • Loading branch information
welcoMattic committed Jul 30, 2024
1 parent 17c9b8f commit b208d96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Maker/UiElementMaker.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function configureCommand(Command $command, InputConfiguration $inputConf
{
$command
->addArgument('code', InputArgument::OPTIONAL, 'The code of the UI Element (e.g. <fg=yellow>my_ui_element</>)')
->addArgument('icon', InputArgument::OPTIONAL, 'The semantic icon code for the UI Element (e.g. <fg=yellow>map pin</>)')
->addArgument('icon', InputArgument::OPTIONAL, 'The semantic icon code for the UI Element (e.g. <fg=yellow>map pin</>)', 'square')
->addArgument('code_prefix', InputArgument::OPTIONAL, 'The code prefix for the UI Element (e.g. <fg=yellow>app</>)', 'app')
->setDescription('Creates a new UI Element FormType and templates')
;
Expand All @@ -48,6 +48,7 @@ public function configureCommand(Command $command, InputConfiguration $inputConf
public function generate(InputInterface $input, ConsoleStyle $io, Generator $generator): void
{
$code = $input->getArgument('code');
$icon = $input->getArgument('icon');
$codePrefix = $input->getArgument('code_prefix');
Assert::string($code);
$name = Str::asCamelCase($code);
Expand All @@ -61,7 +62,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
__DIR__ . '/../Resources/skeleton/UiElementFormType.tpl.php',
[
'code' => sprintf('%s.%s', $codePrefix, $code),
'icon' => 'map pin',
'icon' => $icon,
'tags' => json_encode([]),
]
);
Expand Down

0 comments on commit b208d96

Please sign in to comment.