public static invalidCurrency ( string $currency ) : |
||
$currency | string | |
return |
public static function invalidCurrency(string $currency) : InvalidArgumentException
{
return new self(sprintf('Invalid currency code "%s"', $currency));
}
/** * @param CartId $cartId * @param string $currency * * @throws InvalidArgumentException */ public function __construct(CartId $cartId, string $currency) { if (!Currencies::isValid($currency)) { throw InvalidArgumentException::invalidCurrency($currency); } $this->id = $cartId; $this->items = []; $this->currency = $currency; }