diff --git a/src/CountryShort/CountryAlpha2.php b/src/CountryShort/CountryAlpha2.php index b520cd0a..2d3814fc 100644 --- a/src/CountryShort/CountryAlpha2.php +++ b/src/CountryShort/CountryAlpha2.php @@ -260,17 +260,17 @@ enum CountryAlpha2: string case Zambia = 'ZM'; case Zimbabwe = 'ZW'; - public function toISO3166_1_Alpha_3(): CountryAlpha3 + public function toCountryAlpha3(): CountryAlpha3 { return BackedEnum::fromKey(CountryAlpha3::class, $this->name); } - public function toISO3166_1_Numeric(): CountryNumeric + public function toCountryNumeric(): CountryNumeric { return BackedEnum::fromKey(CountryNumeric::class, $this->name); } - public function toISO3166_Name(): CountryName + public function toCountryName(): CountryName { return BackedEnum::fromKey(CountryName::class, $this->name); } diff --git a/src/CountryShort/CountryAlpha3.php b/src/CountryShort/CountryAlpha3.php index 4f18ba1a..43a2a9cf 100644 --- a/src/CountryShort/CountryAlpha3.php +++ b/src/CountryShort/CountryAlpha3.php @@ -260,17 +260,17 @@ enum CountryAlpha3: string case Zambia = 'ZMB'; case Zimbabwe = 'ZWE'; - public function toISO3166_1_Alpha_2(): CountryAlpha2 + public function toCountryAlpha2(): CountryAlpha2 { return BackedEnum::fromKey(CountryAlpha2::class, $this->name); } - public function toISO3166_1_Numeric(): CountryNumeric + public function toCountryNumeric(): CountryNumeric { return BackedEnum::fromKey(CountryNumeric::class, $this->name); } - public function toISO3166_Name(): CountryName + public function toCountryName(): CountryName { return BackedEnum::fromKey(CountryName::class, $this->name); } diff --git a/src/CountryShort/CountryName.php b/src/CountryShort/CountryName.php index cca957e2..a46057f5 100644 --- a/src/CountryShort/CountryName.php +++ b/src/CountryShort/CountryName.php @@ -260,17 +260,17 @@ enum CountryName: string case Zambia = 'Zambia'; case Zimbabwe = 'Zimbabwe'; - public function toISO3166_1_Alpha_2(): CountryAlpha2 + public function toCountryAlpha2(): CountryAlpha2 { return BackedEnum::fromKey(CountryAlpha2::class, $this->name); } - public function toISO3166_1_Alpha_3(): CountryAlpha3 + public function toCountryAlpha3(): CountryAlpha3 { return BackedEnum::fromKey(CountryAlpha3::class, $this->name); } - public function toISO3166_1_Numeric(): CountryNumeric + public function toCountryNumeric(): CountryNumeric { return BackedEnum::fromKey(CountryNumeric::class, $this->name); } diff --git a/src/CountryShort/CountryNumeric.php b/src/CountryShort/CountryNumeric.php index b9aed93b..5a08840b 100644 --- a/src/CountryShort/CountryNumeric.php +++ b/src/CountryShort/CountryNumeric.php @@ -270,17 +270,17 @@ public static function tryFromInt(int $from): ?self return self::tryFrom(str_pad((string) $from, 3, '0', STR_PAD_LEFT)); } - public function toISO3166_1_Alpha_2(): CountryAlpha2 + public function toCountryAlpha2(): CountryAlpha2 { return BackedEnum::fromKey(CountryAlpha2::class, $this->name); } - public function toISO3166_1_Alpha_3(): CountryAlpha3 + public function toCountryAlpha3(): CountryAlpha3 { return BackedEnum::fromKey(CountryAlpha3::class, $this->name); } - public function toISO3166_Name(): CountryName + public function toCountryName(): CountryName { return BackedEnum::fromKey(CountryName::class, $this->name); } diff --git a/tests/Unit/CountryShort/CountryAlpha2Test.php b/tests/Unit/CountryShort/CountryAlpha2Test.php index 355095c3..8464882c 100644 --- a/tests/Unit/CountryShort/CountryAlpha2Test.php +++ b/tests/Unit/CountryShort/CountryAlpha2Test.php @@ -13,49 +13,49 @@ class CountryAlpha2Test extends TestCase { /** - * @covers ::toISO3166_1_Alpha_3 + * @covers ::toCountryAlpha3 */ - public function testAllCasesCanBeConvertedToISO3166Alpha3(): void + public function testAllCasesCanBeConvertedToCountryAlpha3(): void { $cases = CountryAlpha2::cases(); static::assertNotEmpty($cases); foreach ($cases as $case) { try { - $case->toISO3166_1_Alpha_3(); + $case->toCountryAlpha3(); } catch (TypeError) { - $this->fail(sprintf('Case %s could not be converted to ISO3166_1_Alpha_3', $case->name)); + $this->fail(sprintf('Case %s could not be converted to CountryAlpha3', $case->name)); } } } /** - * @covers ::toISO3166_1_Numeric + * @covers ::toCountryNumeric */ - public function testAllCasesCanBeConvertedToISO3166Numeric(): void + public function testAllCasesCanBeConvertedToCountryNumeric(): void { $cases = CountryAlpha2::cases(); static::assertNotEmpty($cases); foreach ($cases as $case) { try { - $case->toISO3166_1_Numeric(); + $case->toCountryNumeric(); } catch (TypeError) { - $this->fail(sprintf('Case %s could not be converted to ISO3166_1_Numeric', $case->name)); + $this->fail(sprintf('Case %s could not be converted to CountryNumeric', $case->name)); } } } /** - * @covers ::toISO3166_Name + * @covers ::toCountryName */ - public function testAllCasesCanBeConvertedToISO3166Name(): void + public function testAllCasesCanBeConvertedToCountryName(): void { $cases = CountryAlpha2::cases(); static::assertNotEmpty($cases); foreach ($cases as $case) { try { - $case->toISO3166_Name(); + $case->toCountryName(); } catch (TypeError) { - $this->fail(sprintf('Case %s could not be converted to ISO3166_1_Name', $case->name)); + $this->fail(sprintf('Case %s could not be converted to CountryName', $case->name)); } } } diff --git a/tests/Unit/CountryShort/CountryAlpha3Test.php b/tests/Unit/CountryShort/CountryAlpha3Test.php index 67fe1038..d0825ec5 100644 --- a/tests/Unit/CountryShort/CountryAlpha3Test.php +++ b/tests/Unit/CountryShort/CountryAlpha3Test.php @@ -13,49 +13,49 @@ class CountryAlpha3Test extends TestCase { /** - * @covers ::toISO3166_1_Alpha_2 + * @covers ::toCountryAlpha2 */ - public function testAllCasesCanBeConvertedToISO3166Alpha2(): void + public function testAllCasesCanBeConvertedToCountryAlpha2(): void { $cases = CountryAlpha3::cases(); static::assertNotEmpty($cases); foreach ($cases as $case) { try { - $case->toISO3166_1_Alpha_2(); + $case->toCountryAlpha2(); } catch (TypeError) { - $this->fail(sprintf('Case %s could not be converted to ISO3166_1_Alpha_2', $case->name)); + $this->fail(sprintf('Case %s could not be converted to CountryAlpha2', $case->name)); } } } /** - * @covers ::toISO3166_1_Numeric + * @covers ::toCountryNumeric */ - public function testAllCasesCanBeConvertedToISO3166Numeric(): void + public function testAllCasesCanBeConvertedToCountryNumeric(): void { $cases = CountryAlpha3::cases(); static::assertNotEmpty($cases); foreach ($cases as $case) { try { - $case->toISO3166_1_Numeric(); + $case->toCountryNumeric(); } catch (TypeError) { - $this->fail(sprintf('Case %s could not be converted to ISO3166_1_Numeric', $case->name)); + $this->fail(sprintf('Case %s could not be converted to CountryNumeric', $case->name)); } } } /** - * @covers ::toISO3166_Name + * @covers ::toCountryName */ - public function testAllCasesCanBeConvertedToISO3166Name(): void + public function testAllCasesCanBeConvertedToCountryName(): void { $cases = CountryAlpha3::cases(); static::assertNotEmpty($cases); foreach ($cases as $case) { try { - $case->toISO3166_Name(); + $case->toCountryName(); } catch (TypeError) { - $this->fail(sprintf('Case %s could not be converted to ISO3166_1_Name', $case->name)); + $this->fail(sprintf('Case %s could not be converted to CountryName', $case->name)); } } } diff --git a/tests/Unit/CountryShort/CountryNameTest.php b/tests/Unit/CountryShort/CountryNameTest.php index 503aa9d2..b9b8ce74 100644 --- a/tests/Unit/CountryShort/CountryNameTest.php +++ b/tests/Unit/CountryShort/CountryNameTest.php @@ -8,28 +8,28 @@ use TypeError; /** - * @coversDefaultClass \PrinsFrank\Standards\Country\ISO3166_1_Name + * @coversDefaultClass \PrinsFrank\Standards\CountryShort\CountryName */ class CountryNameTest extends TestCase { /** - * @covers ::toISO3166_1_Alpha_2 + * @covers ::toCountryAlpha2 */ - public function testAllCasesCanBeConvertedToISO3166Alpha2(): void + public function testAllCasesCanBeConvertedToCountryAlpha2(): void { $cases = CountryName::cases(); static::assertNotEmpty($cases); foreach ($cases as $case) { try { - $case->toISO3166_1_Alpha_2(); + $case->toCountryAlpha2(); } catch (TypeError) { - $this->fail(sprintf('Case %s could not be converted to ISO3166_1_Alpha_2', $case->name)); + $this->fail(sprintf('Case %s could not be converted to CountryAlpha2', $case->name)); } } } /** - * @covers ::toISO3166_1_Alpha_3 + * @covers ::toCountryAlpha3 */ public function testAllCasesCanBeConvertedToISO3166Alpha3(): void { @@ -37,15 +37,15 @@ public function testAllCasesCanBeConvertedToISO3166Alpha3(): void static::assertNotEmpty($cases); foreach ($cases as $case) { try { - $case->toISO3166_1_Alpha_3(); + $case->toCountryAlpha3(); } catch (TypeError) { - $this->fail(sprintf('Case %s could not be converted to ISO3166_1_Alpha_3', $case->name)); + $this->fail(sprintf('Case %s could not be converted to CountryAlpha3', $case->name)); } } } /** - * @covers ::toISO3166_1_Numeric + * @covers ::toCountryNumeric */ public function testAllCasesCanBeConvertedToISO3166Numeric(): void { @@ -53,9 +53,9 @@ public function testAllCasesCanBeConvertedToISO3166Numeric(): void static::assertNotEmpty($cases); foreach ($cases as $case) { try { - $case->toISO3166_1_Numeric(); + $case->toCountryNumeric(); } catch (TypeError) { - $this->fail(sprintf('Case %s could not be converted to ISO3166_1_Numeric', $case->name)); + $this->fail(sprintf('Case %s could not be converted to CountryNumeric', $case->name)); } } } diff --git a/tests/Unit/CountryShort/CountryNumericTest.php b/tests/Unit/CountryShort/CountryNumericTest.php index dfca5915..c9ba27a6 100644 --- a/tests/Unit/CountryShort/CountryNumericTest.php +++ b/tests/Unit/CountryShort/CountryNumericTest.php @@ -14,49 +14,49 @@ class CountryNumericTest extends TestCase { /** - * @covers ::toISO3166_1_Alpha_2 + * @covers ::toCountryAlpha2 */ - public function testAllCasesCanBeConvertedToISO3166Alpha2(): void + public function testAllCasesCanBeConvertedToCountryAlpha2(): void { $cases = CountryNumeric::cases(); static::assertNotEmpty($cases); foreach ($cases as $case) { try { - $case->toISO3166_1_Alpha_2(); + $case->toCountryAlpha2(); } catch (TypeError) { - $this->fail(sprintf('Case %s could not be converted to ISO3166_1_Alpha_2', $case->name)); + $this->fail(sprintf('Case %s could not be converted to CountryAlpha2', $case->name)); } } } /** - * @covers ::toISO3166_1_Alpha_3 + * @covers ::toCountryAlpha3 */ - public function testAllCasesCanBeConvertedToISO3166Alpha3(): void + public function testAllCasesCanBeConvertedToCountryAlpha3(): void { $cases = CountryNumeric::cases(); static::assertNotEmpty($cases); foreach ($cases as $case) { try { - $case->toISO3166_1_Alpha_3(); + $case->toCountryAlpha3(); } catch (TypeError) { - $this->fail(sprintf('Case %s could not be converted to ISO3166_1_Alpha_3', $case->name)); + $this->fail(sprintf('Case %s could not be converted to CountryAlpha3', $case->name)); } } } /** - * @covers ::toISO3166_Name + * @covers ::toCountryName */ - public function testAllCasesCanBeConvertedToISO3166Name(): void + public function testAllCasesCanBeConvertedToCountryName(): void { $cases = CountryNumeric::cases(); static::assertNotEmpty($cases); foreach ($cases as $case) { try { - $case->toISO3166_Name(); + $case->toCountryName(); } catch (TypeError) { - $this->fail(sprintf('Case %s could not be converted to ISO3166_1_Name', $case->name)); + $this->fail(sprintf('Case %s could not be converted to CountryName', $case->name)); } } }