14 final class Currency implements \JsonSerializable
28 if (!is_string($code)) {
29 throw new \InvalidArgumentException(
'Currency code should be string');
33 throw new \InvalidArgumentException(
'Currency code should not be empty string');
44 public function getCode()
56 public function equals(
Currency $other)
58 return $this->code === $other->code;
68 public function isAvailableWithin(
Currencies $currencies)
70 return $currencies->contains($this);
76 public function __toString()
86 public function jsonSerialize()