Skip to content

Commit

Permalink
Merge pull request #234 from monsieurbiz/fix/ui-element-maker-icon
Browse files Browse the repository at this point in the history
fix(maker): Fix icon argument usage in UiElementMaker
  • Loading branch information
maximehuran authored Aug 26, 2024
2 parents ee199d3 + c4ce8a6 commit 4b44843
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"phpcs": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix --using-cache=no",
"phpstan": "phpstan analyse -c phpstan.neon src/",
"phpstan": "phpstan analyse -c phpstan.neon",
"phpmd": "phpmd --exclude Migrations/* src/ ansi phpmd.xml",
"phpunit": "phpunit",
"phpspec": "phpspec run"
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
level: 8
paths:
- %rootDir%/src/
- src/

excludePaths:
# Makes PHPStan crash
Expand Down
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 4b44843

Please sign in to comment.