MetadataProvider
Table of Contents
Constants
- PARSED_METADATA_FILENAME = 'metadata.php'
Methods
- getCountriesByCode() : array<string|int, mixed>
- Returns array of 2-letter country codes of the countries, sharing the specified phone country code.
- getCountryMetadata() : array<string|int, mixed>|false
- Returns metadata record for the country.
- getInstance() : MetadataProvider
- Returns instance of MetadataProvider.
- isValidCountryCode() : mixed
- parseGoogleMetadata() : array<string|int, mixed>
- Parses google metadata from the PhoneNumberMetadata.xml
- toArray() : mixed
Constants
PARSED_METADATA_FILENAME
public
mixed
PARSED_METADATA_FILENAME
= 'metadata.php'
Methods
getCountriesByCode()
Returns array of 2-letter country codes of the countries, sharing the specified phone country code.
public
getCountriesByCode(string $countryCode) : array<string|int, mixed>
Parameters
- $countryCode : string
-
Phone country code.
Return values
array<string|int, mixed>getCountryMetadata()
Returns metadata record for the country.
public
getCountryMetadata(string $country) : array<string|int, mixed>|false
Parameters
- $country : string
-
2-letter country code.
Return values
array<string|int, mixed>|falsegetInstance()
Returns instance of MetadataProvider.
public
static getInstance() : MetadataProvider
Return values
MetadataProviderisValidCountryCode()
public
isValidCountryCode(mixed $countryCode) : mixed
Parameters
- $countryCode : mixed
parseGoogleMetadata()
Parses google metadata from the PhoneNumberMetadata.xml
public
static parseGoogleMetadata(mixed $fileName) : array<string|int, mixed>
Parameters
- $fileName : mixed
Tags
Return values
array<string|int, mixed> —Returns parsed metadata.
toArray()
public
toArray() : mixed