@@ -15,7 +15,7 @@ final class Money implements JsonSerializable, Arrayable, Wireable
1515 protected Currency $ currency ;
1616
1717 /** Create a new Money instance. */
18- public function __construct (int $ value , Currency |string $ currency = null )
18+ public function __construct (int $ value , Currency |string | null $ currency = null )
1919 {
2020 $ this ->value = $ value ;
2121 $ this ->currency = currency ($ currency );
@@ -34,7 +34,7 @@ protected function newFromDecimal(float $decimal): self
3434 }
3535
3636 /** Create a Money instance from a decimal value. */
37- public static function fromDecimal (float $ decimal , Currency |string $ currency = null ): self
37+ public static function fromDecimal (float $ decimal , Currency |string | null $ currency = null ): self
3838 {
3939 return new static (
4040 (int ) round ($ decimal * pow (10 , currency ($ currency )->mathDecimals ())),
@@ -179,7 +179,7 @@ public function rawFormatted(mixed ...$overrides): string
179179 * @param Currency|string|null $currency The currency to use when passing the overrides. If not provided, the currency of the formatted string is used.
180180 * @param array ...$overrides The overrides used when formatting the money instance.
181181 */
182- public static function fromFormatted (string $ formatted , Currency |string $ currency = null , mixed ...$ overrides ): self
182+ public static function fromFormatted (string $ formatted , Currency |string | null $ currency = null , mixed ...$ overrides ): self
183183 {
184184 $ currency = isset ($ currency )
185185 ? currency ($ currency )
@@ -277,7 +277,7 @@ public function toDefault(): self
277277 }
278278
279279 /** Round the Money to a custom precision. */
280- public function rounded (int $ precision = null ): self
280+ public function rounded (? int $ precision = null ): self
281281 {
282282 $ precision ??= $ this ->currency ->rounding ();
283283
0 commit comments