PHPackages                             davidianbonner/cli-phone-number-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. davidianbonner/cli-phone-number-validator

ActiveLibrary[Framework](/categories/framework)

davidianbonner/cli-phone-number-validator
=========================================

CLI Phone Number Validator using Google's libphonenumber.

1.0.3(8y ago)16MITPHPPHP &gt;=7.1

Since Nov 17Pushed 8y ago1 watchersCompare

[ Source](https://github.com/davidianbonner/cli-phone-number-validator)[ Packagist](https://packagist.org/packages/davidianbonner/cli-phone-number-validator)[ RSS](/packages/davidianbonner-cli-phone-number-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (5)Used By (0)

A CLI Phone Number Validator
============================

[](#a-cli-phone-number-validator)

[![Author](https://camo.githubusercontent.com/a66b2beba8568bac7ad0eb84ae6b620fe7447c711f02ef0a440f76800df58c75/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d4064626f6e6e6572313938372d626c75652e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/dbonner1987)[![Build Status](https://camo.githubusercontent.com/68bc0f60632a789393b14c362041ab915d3a2b0025b002649b665a491d70b3b0/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f646176696469616e626f6e6e65722f636c692d70686f6e652d6e756d6265722d76616c696461746f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/davidianbonner/cli-phone-number-validator)[![Quality Score](https://camo.githubusercontent.com/92488ce9181de5125f3c345a5bc788503caf0990e1eefb11ba2f2ff510c3b075/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f646176696469616e626f6e6e65722f636c692d70686f6e652d6e756d6265722d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/davidianbonner/cli-phone-number-validator)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/davidianbonner/cli-phone-number-validator/blob/master/LICENSE.md)[![Packagist Version](https://camo.githubusercontent.com/8153133084c5fc3aca8c05fb6fbcd5e627df2b5ceb084989b9491c516723ae9b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646176696469616e626f6e6e65722f636c692d70686f6e652d6e756d6265722d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/davidianbonner/cli-phone-number-validator)[![Coverage Status](https://camo.githubusercontent.com/f8c8dd794774aa0d6b4f11c82f35d236d9999a4d82ca08e40f021bb441a64a77/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f646176696469616e626f6e6e65722f636c692d70686f6e652d6e756d6265722d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/davidianbonner/cli-phone-number-validator/code-structure)

### Installation

[](#installation)

Install the application with composer:

```
$ composer create-project davidianbonner/cli-phone-number-validator
```

To create a standalone PHAR of the application for deployment, run:

```
$ php number-validator app:build number-validator
```

This will output a .PHAR to the `build` directory.

### Usage

[](#usage)

The validator comes with a pre-built GB &amp; Channel Islands mobile command: `validate:uk-mobile`. There are two ways to process and validate numbers:

##### List source

[](#list-source)

Pass a list of phone numbers to the validator.

```
$ php number-validator validate:uk-mobile "07712345678" "07712341234" "07283 123 32"
```

##### File source

[](#file-source)

Pass a file with a phone number per-line.

```
$ php number-validator validate:uk-mobile ./path/to/file --file
```

##### Output directory

[](#output-directory)

An output directory is required when using the standalone .PHAR:

```
$ php number-validator validate:uk-mobile ./path/to/file --file --output=/path/to/output/directory
```

### Adding new validators

[](#adding-new-validators)

New validators can be added with minimal effort. First create a new command in `app/Commands` and extends the `BaseValidatorCommand`.

```
