PHPackages                             cherif/algerian-mobile-phone-number - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cherif/algerian-mobile-phone-number

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cherif/algerian-mobile-phone-number
===================================

Algerian mobile phone number value object

v0.5.0(5y ago)246732MITPHPPHP &gt;=7.2.0

Since Jun 10Pushed 5y ago3 watchersCompare

[ Source](https://github.com/cherifGsoul/php-algerian-mobile-phone-number)[ Packagist](https://packagist.org/packages/cherif/algerian-mobile-phone-number)[ RSS](/packages/cherif-algerian-mobile-phone-number/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (1)Versions (10)Used By (2)

Algerian mobile phone number value object
=========================================

[](#algerian-mobile-phone-number-value-object)

Algerian mobile phone number value object implementation that can be used in your domain models or to integrate with your favorite framework.

Installation
------------

[](#installation)

```
composer require cherif/algerian-mobile-phone-number

```

Usage:
------

[](#usage)

### Instantiation:

[](#instantiation)

The class doesn't have a public constructor, it has a named constructor instead in order to preseve its invariants:

```
use Cherif\AlgerianMobilePhoneNumber\AlgerianMobilePhoneNumber;

$phoneNumber = AlgerianMobilePhoneNumber::fromString('0699000000');
```

Or:

```
use Cherif\AlgerianMobilePhoneNumber\AlgerianMobilePhoneNumber;

$phoneNumber = AlgerianMobilePhoneNumber::fromString('06 99 00 00 00');
```

Or:

```
use Cherif\AlgerianMobilePhoneNumber\AlgerianMobilePhoneNumber;

$phoneNumber = AlgerianMobilePhoneNumber::fromString('06-99-00-00-00'); //
```

The value object class accepts international phone indicative, 00213 or +213, too.

> **NOTE**: For now only space and dash "-" separated numbers are accepted.

### API:

[](#api)

#### asString

[](#asstring)

To get the string value of the object:

```
$phoneNumber->asString(); // -> '0699000000'
```

#### equals

[](#equals)

For comparaison check:

```
$other = AlgerianMobilePhoneNumber::fromString('0699000000');
$phoneNumber->equals($other); // -> true
```

#### isMobilis, isDjezzy and isOoredoo

[](#ismobilis-isdjezzy-and-isooredoo)

To know if the object respresents a Mobilis, Djezzy or Ooredoo phone number

```
$phoneNumber = AlgerianMobilePhoneNumber::fromString('0699000000');
$phoneNumber->isMobilis(); // -> true
$phoneNumber->isDjezzy(); // -> false
$phoneNumber->isOoredoo(); // -> false
```

#### withNumber

[](#withnumber)

```
use Cherif\AlgerianMobilePhoneNumber\AlgerianMobilePhoneNumber;

$phoneNumber = AlgerianMobilePhoneNumber::fromString('06-99-00-00-00');
$phoneNumber->withNumber('07-99-00-00-00'); // Will return a new instance that represents the new number
```

#### \_\_toString

[](#__tostring)

Casts the value object to string:

```
$phoneNumber = AlgerianMobilePhoneNumber::fromString('0699000000');
(string)$phoneNumber; // -> '0699000000'
```

Contribution
------------

[](#contribution)

Contributions are welcome to make this library better.

- Clone the repo:

```
$ git clone git@github.com:cherifGsoul/php-algerian-mobile-phone-number.git
```

and enter to the cloned repository directory.

- Install dependencies:

```
$ composer install
```

### Testing:

[](#testing)

Run composer script for testing:

```
$ composer test
```

License
-------

[](#license)

[MIT License](LICENSE).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

9

Last Release

2158d ago

PHP version history (2 changes)v0.1PHP 7.2.0

v0.1.1PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f4be70b1b1d59ebec6b57be354923c82f8c9d445e612398e73a838c48130183b?d=identicon)[cherif\_b](/maintainers/cherif_b)

---

Top Contributors

[![cherifGsoul](https://avatars.githubusercontent.com/u/109013?v=4)](https://github.com/cherifGsoul "cherifGsoul (24 commits)")[![hfend](https://avatars.githubusercontent.com/u/1250814?v=4)](https://github.com/hfend "hfend (2 commits)")[![celyes](https://avatars.githubusercontent.com/u/21331907?v=4)](https://github.com/celyes "celyes (1 commits)")

### Embed Badge

![Health badge](/badges/cherif-algerian-mobile-phone-number/health.svg)

```
[![Health](https://phpackages.com/badges/cherif-algerian-mobile-phone-number/health.svg)](https://phpackages.com/packages/cherif-algerian-mobile-phone-number)
```

###  Alternatives

[hcodes/server_yametrika

Server-side tracking of visitors using Yandex.Metrica

7220.2k](/packages/hcodes-server-yametrika)[axllent/silverstripe-trailing-slash

Ensure that a single trailing slash is always added to the URL

11182.6k5](/packages/axllent-silverstripe-trailing-slash)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
