Skip to content

Commit

Permalink
Implicitly set amount to zero when a null value is provided (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-jan authored Mar 11, 2022
1 parent 9b898fc commit 504651f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Value/Arithmetic/Amount.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct($value)
throw new InvalidArgument(\sprintf('Amount must be a whole number, "%s" given', $value));
}

parent::__construct($value, 0);
parent::__construct($value ?? 0, 0);
}

public function toInt(): int
Expand Down

0 comments on commit 504651f

Please sign in to comment.