diff --git a/dev/DataSource/Country/ISO3166_1_Alpha_2_Source.php b/dev/DataSource/Country/CountryAlpha2Source.php similarity index 91% rename from dev/DataSource/Country/ISO3166_1_Alpha_2_Source.php rename to dev/DataSource/Country/CountryAlpha2Source.php index 8237a16..eb71fee 100644 --- a/dev/DataSource/Country/ISO3166_1_Alpha_2_Source.php +++ b/dev/DataSource/Country/CountryAlpha2Source.php @@ -4,12 +4,12 @@ namespace PrinsFrank\Standards\Dev\DataSource\Country; -use PrinsFrank\Standards\Country\ISO3166_1_Alpha_2; +use PrinsFrank\Standards\Country\CountryAlpha2; use PrinsFrank\Standards\Dev\DataSource\HtmlDataSource; use Symfony\Component\Panther\Client; use Symfony\Component\Panther\DomCrawler\Crawler; -class ISO3166_1_Alpha_2_Source implements HtmlDataSource +class CountryAlpha2Source implements HtmlDataSource { public static function url(): string { @@ -43,7 +43,7 @@ public static function transformValue(string $value): string|int|null public static function getSpecFQN(): string { - return ISO3166_1_Alpha_2::class; + return CountryAlpha2::class; } public static function getKeyEnumFQN(): string diff --git a/dev/DataSource/Country/ISO3166_1_Alpha_3_Source.php b/dev/DataSource/Country/CountryAlpha3Source.php similarity index 91% rename from dev/DataSource/Country/ISO3166_1_Alpha_3_Source.php rename to dev/DataSource/Country/CountryAlpha3Source.php index 659872e..9a2d3a8 100644 --- a/dev/DataSource/Country/ISO3166_1_Alpha_3_Source.php +++ b/dev/DataSource/Country/CountryAlpha3Source.php @@ -4,12 +4,12 @@ namespace PrinsFrank\Standards\Dev\DataSource\Country; -use PrinsFrank\Standards\Country\ISO3166_1_Alpha_3; +use PrinsFrank\Standards\Country\CountryAlpha3; use PrinsFrank\Standards\Dev\DataSource\HtmlDataSource; use Symfony\Component\Panther\Client; use Symfony\Component\Panther\DomCrawler\Crawler; -class ISO3166_1_Alpha_3_Source implements HtmlDataSource +class CountryAlpha3Source implements HtmlDataSource { public static function url(): string { @@ -43,7 +43,7 @@ public static function transformValue(string $value): string|int|null public static function getSpecFQN(): string { - return ISO3166_1_Alpha_3::class; + return CountryAlpha3::class; } public static function getKeyEnumFQN(): string diff --git a/dev/DataSource/Country/ISO3166_1_Name_Source.php b/dev/DataSource/Country/CountryNameSource.php similarity index 87% rename from dev/DataSource/Country/ISO3166_1_Name_Source.php rename to dev/DataSource/Country/CountryNameSource.php index d249e7b..a1a3d0f 100644 --- a/dev/DataSource/Country/ISO3166_1_Name_Source.php +++ b/dev/DataSource/Country/CountryNameSource.php @@ -4,13 +4,13 @@ namespace PrinsFrank\Standards\Dev\DataSource\Country; -use PrinsFrank\Standards\Country\ISO3166_1_Alpha_2; -use PrinsFrank\Standards\Country\ISO3166_1_Name; +use PrinsFrank\Standards\Country\CountryAlpha2; +use PrinsFrank\Standards\Country\CountryName; use PrinsFrank\Standards\Dev\DataSource\HtmlDataSource; use Symfony\Component\Panther\Client; use Symfony\Component\Panther\DomCrawler\Crawler; -class ISO3166_1_Name_Source implements HtmlDataSource +class CountryNameSource implements HtmlDataSource { public static function url(): string { @@ -44,12 +44,12 @@ public static function transformValue(string $value): string|int|null public static function getSpecFQN(): string { - return ISO3166_1_Name::class; + return CountryName::class; } public static function getKeyEnumFQN(): string { - return ISO3166_1_Alpha_2::class; + return CountryAlpha2::class; } public static function afterPageLoad(Client $client, Crawler $crawler): void diff --git a/dev/DataSource/Country/ISO3166_1_Numeric_Source.php b/dev/DataSource/Country/CountryNumericSource.php similarity index 96% rename from dev/DataSource/Country/ISO3166_1_Numeric_Source.php rename to dev/DataSource/Country/CountryNumericSource.php index 31147e2..b22a112 100644 --- a/dev/DataSource/Country/ISO3166_1_Numeric_Source.php +++ b/dev/DataSource/Country/CountryNumericSource.php @@ -9,7 +9,7 @@ use Symfony\Component\Panther\Client; use Symfony\Component\Panther\DomCrawler\Crawler; -class ISO3166_1_Numeric_Source implements HtmlDataSource +class CountryNumericSource implements HtmlDataSource { public static function url(): string { diff --git a/dev/DataSource/CountryShort/CountryAlpha2Source.php b/dev/DataSource/CountryShort/CountryAlpha2Source.php deleted file mode 100644 index 6ecd28b..0000000 --- a/dev/DataSource/CountryShort/CountryAlpha2Source.php +++ /dev/null @@ -1,15 +0,0 @@ -> */ public const COUNTRY_SOURCES = [ - ISO3166_1_Numeric_Source::class, - ISO3166_1_Alpha_2_Source::class, - ISO3166_1_Alpha_3_Source::class, - ISO3166_1_Name_Source::class, - ]; - - /** @var array> */ - public const COUNTRY_SHORT_SOURCES = [ CountryNumericSource::class, CountryAlpha2Source::class, CountryAlpha3Source::class, @@ -55,9 +43,9 @@ class SpecUpdater /** @var array> */ public const CURRENCY_SOURCES = [ - ISO4217_Alpha_3_Source::class, - ISO4217_Numeric_Source::class, - ISO4217_Name_Source::class, + CurrencyAlpha3Source::class, + CurrencyNumericSource::class, + CurrencyNameSource::class, ]; /** @var array> */ @@ -72,11 +60,11 @@ class SpecUpdater /** @var array> */ public const LANGUAGE_SOURCES = [ - ISO639_1_Alpha_2_Source::class, - ISO639_2_Alpha_3_Bibliographic_Source::class, - ISO639_2_Alpha_3_Terminology_Source::class, - ISO639_2_Alpha_3_Common_Source::class, - ISO639_Name_Source::class, + LanguageAlpha2Source::class, + LanguageAlpha3BibliographicSource::class, + LanguageAlpha3TerminologySource::class, + LanguageAlpha3CommonSource::class, + LanguageNameSource::class, ]; private const MAX_TRIES = 5; @@ -91,7 +79,6 @@ public static function update(Event $event): void $sources = match (UnitEnum::tryFromKey(SpecType::class, strtoupper(str_replace('-', '_', $type)))) { SpecType::COUNTRY => self::COUNTRY_SOURCES, - SpecType::COUNTRY_SHORT => self::COUNTRY_SHORT_SOURCES, SpecType::CURRENCY => self::CURRENCY_SOURCES, SpecType::HTTP_STATUS_CODES => self::HTTP_STATUS_CODE_SOURCES, SpecType::HTTP_METHODS => self::HTTP_METHOD_SOURCES,