Skip to content

Commit ab8fc60

Browse files
authored
Merge pull request #678 from giggsey/metadata-in-classes
Store metadata in objects instead of arrays
2 parents 18f14d9 + 9fa9df0 commit ab8fc60

File tree

1,689 files changed

+482915
-503066
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,689 files changed

+482915
-503066
lines changed

Diff for: .gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ tests/ export-ignore
55
.gitattributes export-ignore
66
.gitignore export-ignore
77
.php-cs-fixer.dist.php export-ignore
8-
build.xml export-ignore
98
phpunit.xml.dist export-ignore
109
.github/ export-ignore
1110
src/CountryCodeToRegionCodeMapForTesting.php export-ignore

Diff for: README.md

+10-27
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ A PHP library for parsing, formatting, storing and validating international phon
1111
- [Installation](#installation)
1212
- [Documentation](#documentation)
1313
- [Online Demo](#online-demo)
14-
- [Highlights of functionality](#highlights-of-functionality)
15-
- [Versioning](#versioning)
16-
- [Quick Examples](#quick-examples)
17-
- [Geocoder](#geocoder)
18-
- [ShortNumberInfo](#shortnumberinfo)
19-
- [Mapping Phone Numbers to Carrier](#mapping-phone-numbers-to-carrier)
20-
- [Mapping Phone Numbers to TimeZones](#mapping-phone-numbers-to-timezones)
14+
- [Versioning](#versioning)
15+
- [Quick Examples](#quick-examples)
16+
- [Geocoder](#geocoder)
17+
- [ShortNumberInfo](#shortnumberinfo)
18+
- [Mapping Phone Numbers to Carrier](#mapping-phone-numbers-to-carrier)
19+
- [Mapping Phone Numbers to TimeZones](#mapping-phone-numbers-to-timezones)
2120
- [FAQ](#faq)
2221
- [Problems with Invalid Numbers?](#problems-with-invalid-numbers)
2322
- [Generating data](#generating-data)
@@ -61,16 +60,6 @@ This library will be updated to use [supported versions of PHP](https://www.php.
6160
## Online Demo
6261
An [online demo](http://giggsey.com/libphonenumber/) is available, and the source can be found at [giggsey/libphonenumber-example](https://github.com/giggsey/libphonenumber-example).
6362

64-
# Highlights of functionality
65-
* Parsing/formatting/validating phone numbers for all countries/regions of the world.
66-
* `getNumberType` - gets the type of the number based on the number itself; able to distinguish Fixed-line, Mobile, Toll-free, Premium Rate, Shared Cost, VoIP and Personal Numbers (whenever feasible).
67-
* `isNumberMatch` - gets a confidence level on whether two numbers could be the same.
68-
* `getExampleNumber`/`getExampleNumberByType` - provides valid example numbers for all countries/regions, with the option of specifying which type of example phone number is needed.
69-
* `isValidNumber` - full validation of a phone number for a region using length and prefix information.
70-
* `PhoneNumberOfflineGeocoder` - provides geographical information related to a phone number.
71-
* `PhoneNumberToTimeZonesMapper` - provides timezone information related to a phone number.
72-
* `PhoneNumberToCarrierMapper` - provides carrier information related to a phone number.
73-
7463
## Versioning
7564

7665
This library will try to follow the same version numbers as Google. There could be additional releases where needed to fix critical issues that can not wait until the next release from Google.
@@ -240,21 +229,15 @@ If Google's [Online Demo](https://libphonenumber.appspot.com/) gives a different
240229

241230
## Generating data
242231

243-
Generating the data is not normally needed, as this repository will generally always have the up to data metadata.
232+
Generating the data is not normally needed, as this repository will generally always have the up to date metadata.
244233

245-
If you do need to generate the data, the commands are provided by [Phing](https://www.phing.info). Ensure you have all the dev composer dependencies installed, then run
234+
To compile the data, run the composer script 'build'
246235

247236
```bash
248-
vendor/bin/phing compile
237+
composer run build
249238
```
250239

251-
This compile process clones the [libphonenumber](https://github.com/google/libphonenumber) project at the version specified in [METADATA-VERSION.php](METADATA-VERSION.php).
252-
253-
### Running tests
254-
255-
This project uses [PHPUnit Bridge](https://symfony.com/doc/current/components/phpunit_bridge.html) to maintain compatibility for the supported PHP versions.
256-
257-
To run the tests locally, run the `./phpunit` script.
240+
This build process clones the [libphonenumber](https://github.com/google/libphonenumber) project at the version specified in [METADATA-VERSION.php](METADATA-VERSION.php).
258241

259242
## Integration with frameworks
260243

Diff for: build.xml

-221
This file was deleted.

Diff for: build/BuildApplication.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace libphonenumber\buildtools;
66

7+
use libphonenumber\buildtools\Commands\BuildCommand;
78
use libphonenumber\buildtools\Commands\BuildMetadataPHPFromXMLCommand;
89
use libphonenumber\buildtools\Commands\GeneratePhonePrefixDataCommand;
910
use libphonenumber\buildtools\Commands\GenerateTimeZonesMapDataCommand;
@@ -14,14 +15,15 @@
1415
*/
1516
class BuildApplication extends Application
1617
{
17-
public const VERSION = '5';
18+
public const VERSION = '9';
1819

1920
public function __construct()
2021
{
2122
parent::__construct('libphonenumber Data Builder', self::VERSION);
2223

2324
$this->addCommands(
2425
[
26+
new BuildCommand(),
2527
new BuildMetadataPHPFromXMLCommand(),
2628
new GeneratePhonePrefixDataCommand(),
2729
new GenerateTimeZonesMapDataCommand(),

0 commit comments

Comments
 (0)