diff --git a/src/CountryShort/CountryAlpha2.php b/src/CountryShort/CountryAlpha2.php new file mode 100644 index 00000000..c7c74bb2 --- /dev/null +++ b/src/CountryShort/CountryAlpha2.php @@ -0,0 +1,282 @@ +name); + } + + public function toISO3166_1_Numeric(): CountryNumeric + { + return BackedEnum::fromKey(CountryNumeric::class, $this->name); + } + + public function toISO3166_Name(): CountryName + { + return BackedEnum::fromKey(CountryName::class, $this->name); + } + + public function lowerCaseValue(): string + { + return strtolower($this->value); + } +} diff --git a/src/CountryShort/CountryAlpha3.php b/src/CountryShort/CountryAlpha3.php new file mode 100644 index 00000000..e8f3cc29 --- /dev/null +++ b/src/CountryShort/CountryAlpha3.php @@ -0,0 +1,282 @@ +name); + } + + public function toISO3166_1_Numeric(): CountryNumeric + { + return BackedEnum::fromKey(CountryNumeric::class, $this->name); + } + + public function toISO3166_Name(): CountryName + { + return BackedEnum::fromKey(CountryName::class, $this->name); + } + + public function lowerCaseValue(): string + { + return strtolower($this->value); + } +} diff --git a/src/CountryShort/CountryName.php b/src/CountryShort/CountryName.php new file mode 100644 index 00000000..f1dff049 --- /dev/null +++ b/src/CountryShort/CountryName.php @@ -0,0 +1,277 @@ +name); + } + + public function toISO3166_1_Alpha_3(): CountryAlpha3 + { + return BackedEnum::fromKey(CountryAlpha3::class, $this->name); + } + + public function toISO3166_1_Numeric(): CountryNumeric + { + return BackedEnum::fromKey(CountryNumeric::class, $this->name); + } +} diff --git a/src/CountryShort/CountryNumeric.php b/src/CountryShort/CountryNumeric.php new file mode 100644 index 00000000..6debeb3b --- /dev/null +++ b/src/CountryShort/CountryNumeric.php @@ -0,0 +1,292 @@ +name); + } + + public function toISO3166_1_Alpha_3(): CountryAlpha3 + { + return BackedEnum::fromKey(CountryAlpha3::class, $this->name); + } + + public function toISO3166_Name(): CountryName + { + return BackedEnum::fromKey(CountryName::class, $this->name); + } + + public function valueAsInt(): int + { + return (int) $this->value; + } +}