PHPackages                             tnmdev/msisdn-helpers - 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. tnmdev/msisdn-helpers

ActiveLibrary

tnmdev/msisdn-helpers
=====================

MSISDN Helpers

v1.4.0(1y ago)32.6k2MITPHPPHP ^7.4|^8.0

Since May 7Pushed 1y ago2 watchersCompare

[ Source](https://github.com/tnmdevs/msisdn-helpers)[ Packagist](https://packagist.org/packages/tnmdev/msisdn-helpers)[ RSS](/packages/tnmdev-msisdn-helpers/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (2)

Malawi Phone Number Helpers
===========================

[](#malawi-phone-number-helpers)

Phone number formatters and validator for all Mobile Networks in Malawi

How to install
--------------

[](#how-to-install)

```
composer require tnmdev/msisdn-helpers

```

Creating new number
-------------------

[](#creating-new-number)

MSISDN factory creates an instance of interface IMSISDN for any operator `(new MsisdnFactory('0888800900'))->make();` of `TNM\Msisdn` namespace

The `make` method returns an instance of MSISDN interface or throws `MsisdnException` of `TNM\Msisdn` namespace if the value passed is not a valid Malawian phone number

You can also use `msisdn('+265999900900')` which aliases to the MSISDN factory

The factory strips out all spaces and special characters, so any of the following formats will be recognised as Malawian phone numbers: 0888800900, 265888800900, +265888800900, +265 888 800 900, +265 888 80 09 00, 0888-800-900,

FAN FACT: Even if you put a movie within the phone number, it will be parsed as a valid number 😛

Formatters
----------

[](#formatters)

### Humanize

[](#humanize)

```
msisdn('265-888-800-900')->humanize();
// returns 0888800900
```

### Internationalize

[](#internationalize)

```
msisdn('01800900')->internationalize();
// returns 2651800900
```

To add the international format prefix `+` symbol, pass `true` to `internationalize`

```
msisdn('01800900')->internationalize(true);
// returns +2651800900
```

### Base string

[](#base-string)

```
msisdn('0999800900')->toString();
// returns 999800900
```

Validators
----------

[](#validators)

### Valid TNM Number

[](#valid-tnm-number)

```
is_valid_tnm_number('01800900');
// returns false
```

### Valid Malawian Number

[](#valid-malawian-number)

```
is_valid_malawian_number('01800900');
// returns true
```

### Valid MTL Number

[](#valid-mtl-number)

```
use TNM\Msisdn\Operators\MTLMsisdn;

msisdn('0999800900') instanceof MTLMsisdn;
// return false

msisdn('01800900') instanceof MTLMsisdn;
// return true
```

With the method above, you can validate other classes: `TNM\Msisdn\Operators\AirtelMsisdn` and `TNM\Msisdn\Operators\AccessMsisdn`

Testing
-------

[](#testing)

```
phpunit tests

```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 57.5% 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 ~312 days

Total

5

Last Release

588d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d3b3fb05eea17b856fe1984117288d1d256a917b358555b801681301cefbb02?d=identicon)[saul.chelewani](/maintainers/saul.chelewani)

---

Top Contributors

[![saulchelewani](https://avatars.githubusercontent.com/u/12005903?v=4)](https://github.com/saulchelewani "saulchelewani (23 commits)")[![caspater](https://avatars.githubusercontent.com/u/36881848?v=4)](https://github.com/caspater "caspater (14 commits)")[![ceekays](https://avatars.githubusercontent.com/u/71360?v=4)](https://github.com/ceekays "ceekays (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tnmdev-msisdn-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/tnmdev-msisdn-helpers/health.svg)](https://phpackages.com/packages/tnmdev-msisdn-helpers)
```

PHPackages © 2026

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