A collection of standards as PHP Enums: ISO3166, ISO4217, ISO639...
MIT License
Bot releases are hidden (Show)
Published by PrinsFrank about 2 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.10.0...v3.10.1
Published by PrinsFrank 3 months ago
shaw
got unassigned by @github-actions in https://github.com/PrinsFrank/standards/pull/245
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.9.0...v3.10.0
Published by PrinsFrank 4 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.8.8...v3.9.0
Published by PrinsFrank 4 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.8.7...v3.8.8
Published by PrinsFrank 4 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.8.6...v3.8.7
Published by PrinsFrank 4 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.8.5...v3.8.6
Published by PrinsFrank 4 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.8.4...v3.8.5
Published by PrinsFrank 4 months ago
This minor release adds missing @throws
annotations for InvalidArgumentExceptions
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.8.3...v3.8.4
Published by PrinsFrank 6 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.8.2...v3.8.3
Published by PrinsFrank 7 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.8.1...v3.8.2
Published by PrinsFrank 8 months ago
.comcast and .xfinity Top Level Domains are now not assigned;
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.8.0...v3.8.1
Published by PrinsFrank 9 months ago
There are 6 categories of Top Level Domains, and all of them have been introduced as seperate enums:
CountryCodeTLD::from('nl'); // CountryCodeTLD::nl
CountryCodeTLD::nl; // CountryCodeTLD::nl
CountryCodeTLD::from('nl')->value; // 'nl'
CountryCodeTLD::from('nl')->name; // 'nl'
CountryCodeTLD::from('nl')->isAssigned(); // true
CountryCodeTLD::from('nl')->getCountryAlpha2(); // CountryAlpha2::Netherlands
CountryCodeTLD::from('nl')->getCountryAlpha3(); // CountryAlpha3::Netherlands
CountryCodeTLD::from('nl')->getCountryNumeric(); // CountryNumeric::Netherlands
GenericRestrictedTLD::from('name'); // GenericRestrictedTLD::name
GenericRestrictedTLD::name; // GenericRestrictedTLD::name
GenericRestrictedTLD::from('name')->value; // 'name'
GenericRestrictedTLD::from('name')->name; // 'name'
GenericRestrictedTLD::from('name')->isAssigned(); // true
GenericTLD::from('aaa'); // GenericTLD::aaa
GenericTLD::aaa; // GenericTLD::aaa
GenericTLD::from('aaa')->value; // 'aaa'
GenericTLD::from('aaa')->name; // 'aaa'
GenericTLD::from('aaa')->isAssigned(); // true
InfrastructureTLD::from('arpa'); // InfrastructureTLD::arpa
InfrastructureTLD::arpa; // InfrastructureTLD::arpa
InfrastructureTLD::from('arpa')->value; // 'arpa'
InfrastructureTLD::from('arpa')->name; // 'arpa'
InfrastructureTLD::from('arpa')->isAssigned(); // true
SponsoredTLD::from('aero'); // SponsoredTLD::aero
SponsoredTLD::arpa; // SponsoredTLD::aero
SponsoredTLD::from('aero')->value; // 'aero'
SponsoredTLD::from('aero')->name; // 'aero'
SponsoredTLD::from('aero')->isAssigned(); // true
TestTLD::from('テスト'); // TestTLD::tesuto_katakana
TestTLD::tesuto_katakana; // TestTLD::tesuto_katakana
TestTLD::from('テスト')->value; // 'テスト'
TestTLD::from('テスト')->name; // 'tesuto_katakana'
TestTLD::from('テスト')->isAssigned() // false
It is now possible to retrieve the script(s) for a string:
ScriptAlias::allForString('еюeuеюευ'); // [ScriptAlias::Cyrillic, ScriptAlias::Greek, ScriptAlias::Latin]
ScriptAlias::hasMultipleForString('еюeuеюευ'); // true
ScriptAlias::mostCommonInString('еюeuеюευ'); // ScriptAlias::Cyrillic
ScriptCode::allForString('еюeuеюευ'); // [ScriptCode::Cyrillic, ScriptCode::Greek, ScriptCode::Latin]
ScriptCode::hasMultipleForString('еюeuеюευ'); // true
ScriptCode::mostCommonInString('еюeuеюευ'); // ScriptCode::Cyrillic
ScriptNumber::allForString('еюeuеюευ'); // [ScriptNumber::Cyrillic, ScriptAlias::Greek, ScriptAlias::Latin]
ScriptNumber::hasMultipleForString('еюeuеюευ'); // true
ScriptNumber::mostCommonInString('еюeuеюευ'); // ScriptNumber::Cyrillic
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.7.0...v3.8.0
Published by PrinsFrank 10 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.6.0...v3.7.0
Published by PrinsFrank 10 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.5.0...v3.6.0
Published by PrinsFrank 10 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.4.0...v3.5.0
Published by PrinsFrank 10 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.3.0...v3.4.0
Published by PrinsFrank 11 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.2.0...v3.3.0
Published by PrinsFrank 11 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.1.0...v3.2.0
Published by PrinsFrank 11 months ago
Full Changelog: https://github.com/PrinsFrank/standards/compare/v3.0.0...v3.1.0
Published by PrinsFrank 11 months ago
Language tags have been added. It is possible to construct a language tag from seperate parts, but much more useful is the parsing of language tags from strings:
+ LanguageTag::from('yue-HK'); // new LanguageTag(LanguageAlpha3Extensive::Yue_Chinese, regionSubtag: CountryAlpha2::Hong_Kong)
+ LanguageTag::from('yue-HK')->regionSubtag; // CountryAlpha2::Hong_Kong
+ new LanguageTag(LanguageAlpha3Extensive::Yue_Chinese, regionSubtag: CountryAlpha2::Hong_Kong);
If you have a country, it is now possible to get it's country calling prefix and the other way round:
+ CountryAlpha2::from('US')->getCountryCallingCodes(); // [CountryCallingCode::Integrated_numbering_plan]
+ CountryCallingCode::from(358)->getCountriesAlpha2(); // [CountryAlpha2::Finland, CountryAlpha2::Aland_Islands]
International call prefixes were already added, but the relation to specific countries was not there yet. In this release it is now possible to retrieve an international call prefix for a country and the other way round:
+ CountryAlpha2::from('NL')->getInternationalCallPrefix()->value; // '00'
+ InternationalCallPrefix::from('000')->getCountries(); // [CountryAlpha2::Kenya, CountryAlpha2::Singapore, CountryAlpha2::Tanzania, CountryAlpha2::Uganda]
With the introduction of language tags, it is now also possible to create a language tag instance from a language directly:
$language = LanguageAlpha3Terminology::from('nld')
+ $languageTag = $language->toLanguageTag();
This method has been added to LanguageAlpha2, LanguageAlpha3Bibliographic, LanguageAlpha3Terminology and LanguageAlpha3Extensive.
It is now possible to retrieve the country flag emoji from a country:
+ CountryAlpha3::from('NLD')->getFlagEmoji(); // '🇳🇱'
This might not be displayed correctly in these release notes if you're on windows, see https://prinsfrank.nl/2021/01/25/Non-existing-flag-emojis-on-windows to make these flag emojis visible for Windows users.
(See UPGRADING.md)
LanguageAlpha3Common contained all the cases that were present in both LanguageAlpha3Bibliographic and LanguageAlpha3Terminology. That resulted in complicated type hints. For the sake of simplicity these have now been merged. All the cases that were present in the LanguageAlpha3Common enum are now also present in the LanguageAlpha3Bibliographic and LanguageAlpha3Terminology enums, and the LanguageAlpha3Common class has been removed.
This change also results in the return types of the methods on language classes 'toLanguageAlpha3Terminology' changing from an intersection type with the common class to just an instance of LanguageAlpha3Terminology or null and the 'toLanguageAlpha3Bibliographic' changing from an intersection type with the common class to just an instance of LanguageAlpha3Bibliographic or null.
To process this change, simply remove all references to the following class:
- LanguageAlpha3Common
In the previous release 2.5.0, the naming for scriptCode and ScriptNumber were swapped. In this release the naming has been fixed. If you used any of these classes already, please swap them in your code as well:
- ScriptCode
+ ScriptName
- ScriptName
+ ScriptCode
A typo in the name of Global Mobile Satellite System has been fixed. If you were using the Global_Mobile_Satelite_System_shared_code
case of CountryCallingCode as a hardcoded value in your codebase, you schould change it: (Note the extra letter 'l')
- CountryCallingCode::Global_Mobile_Satelite_System_shared_code;
+ CountryCallingCode::Global_Mobile_Satellite_System_shared_code;
These classes should not be used outside of this package, as the method signature might change between minor versions. As such, these classes are now marked internal. If you use the classes in your code you can continue to do so at your own risk, or you might want to remove their usages.
Full Changelog: https://github.com/PrinsFrank/standards/compare/v2.5.0...v3.0.0