Skip to content

Commit

Permalink
Split CountryCode label method into multiple parts.
Browse files Browse the repository at this point in the history
  • Loading branch information
firebed committed Aug 21, 2024
1 parent 3b4ce63 commit ab5c04a
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/Enums/CountryCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,13 @@ public function label(): string
self::CX => "Νήσος των Χριστουγέννων",
self::CY => "Κύπρος",
self::CZ => "Τσεχία",
default => $this->label_2(),
};
}

private function label_2(): string
{
return match ($this) {
self::DE => "Γερμανία",
self::DJ => "Τζιμπουτί",
self::DK => "Δανία",
Expand Down Expand Up @@ -370,6 +377,13 @@ public function label(): string
self::JM => "Τζαμάικα",
self::JO => "Ιορδανία",
self::JP => "Ιαπωνία",
default => $this->label_3(),
};
}

private function label_3(): string
{
return match ($this) {
self::KE => "Κένυα",
self::KG => "Κιργιζία",
self::KH => "Καμπότζη",
Expand Down Expand Up @@ -449,6 +463,13 @@ public function label(): string
self::RS => "Σερβία",
self::RU => "Ρωσία",
self::RW => "Ρουάντα",
default => $this->label_4(),
};
}

private function label_4(): string
{
return match ($this) {
self::SA => "Σαουδική Αραβία",
self::SB => "Νήσοι Σολομώντος",
self::SC => "Σεϋχέλλες",
Expand Down Expand Up @@ -506,7 +527,7 @@ public function label(): string
self::ZW => "Ζιμπάμπουε",
};
}

public function isInEuropeanUnion(): bool
{
return in_array($this, self::europeanUnionCountries());
Expand Down

0 comments on commit ab5c04a

Please sign in to comment.