Skip to content

Commit

Permalink
Merge pull request #56 from FriendsOfShopware/cherry-pick-0.3-c79e2c6…
Browse files Browse the repository at this point in the history
…cae8f9592bdbd9cd4cfc8735ed7687928

fix: formatting of values when they are nullable, fixes #52
  • Loading branch information
shyim committed Feb 22, 2023
2 parents a1b3d5e + 606dc06 commit 30164d0
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 30164d0

Please sign in to comment.