Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(maker): Fix icon argument usage in UiElementMaker #234

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading