Skip to content

Commit

Permalink
Merge pull request #55 from FriendsOfShopware/fix-int-formatting
Browse files Browse the repository at this point in the history
fix: formatting of values when they are nullable, fixes #52
  • Loading branch information
shyim authored and web-flow committed Feb 22, 2023
1 parent a1b3d5e commit 606dc06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Component/Generator/QuestionHandler/GenericHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ public function handle(Definition $definition, SymfonyStyle $io, string $name, s
} else if(strlen((string) $answer) && $parameter->hasType()) {
$parameterType = (string) $parameter->getType();

if ($parameterType === 'int') {
if ($parameterType === 'int' || $parameterType === '?int') {
$answer = (int) $answer;
} else if($parameterType === 'float') {
} else if($parameterType === 'float' || $parameterType === '?float') {
$answer = (float) $answer;
}
}
Expand Down

0 comments on commit 606dc06

Please sign in to comment.