invalidCurrency() public static method

public static invalidCurrency ( string $currency ) : InvalidArgumentException
$currency string
return InvalidArgumentException
Beispiel #1
0
 /**
  * @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;
 }