public static function fromCode($code) { if (!is_string($code) || strlen($code) !== 3) { throw new InvalidArgumentException('Currency code should be 3 letter ISO code'); } return new self($code); }