PHPackages                             alwaysblank/rotary - 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. alwaysblank/rotary

ActiveLibrary

alwaysblank/rotary
==================

Handle phone numbers.

2.1.0(4y ago)81.5k[1 issues](https://github.com/alwaysblank/rotary/issues)MITPHPPHP ^7.2

Since Jul 26Pushed 4y agoCompare

[ Source](https://github.com/alwaysblank/rotary)[ Packagist](https://packagist.org/packages/alwaysblank/rotary)[ RSS](/packages/alwaysblank-rotary/feed)WikiDiscussions master Synced 3d ago

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

Rotary ☎
========

[](#rotary-)

**Simplify working with phone numbers.**

[![Build Status](https://camo.githubusercontent.com/7275f69694197525c00936242a7b04df00e4c7953482e3c18deb2ed7cc743749/68747470733a2f2f7472617669732d63692e6f72672f616c77617973626c616e6b2f726f746172792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alwaysblank/rotary)

Warning ⚠
---------

[](#warning-)

Rotary will support numbers that look like the standard number format used in the United State of America, i.e. `nnn-nnnn` or `nnn nnn-nnnn`. These can also be prepended with an international country code up to 5 digit long, i.e. `nn nnn nnn-nnnn`. Numbers that deviate from this pattern cannot be reliably interpreted.

Usage 💪
-------

[](#usage-)

Although all the internal behaviors are easily accessible (with the exception of the `Number` class, all methods are available as static methods), in general, you'll just be using these methods from the `Render` class:

- `pretty` will result in `(123) 456-7890` or `456-7890`.
- `simple` will result in `123 456-7890` or `456-7890`.
- `href` will result in `tel:+11234567890` or `tel:+14567890`.
- `normalized` will result in `1234567890` or `567890`.

You can call them like this:

```
use AlwaysBlank\Rotary\Render;

echo Render::pretty('1234567890');
// (123) 456-7890

echo Render::pretty('123 456 7890');
// (123) 456-7890

echo Render::pretty('[123)    456/7890');
// (123) 456-7890
```

You can also instantiate a `Rotary` object, which has methods for the different format types:

```
use AlwaysBlank\Rotary\Rotary;

$Rotary = new Rotary('123456789');
echo $Rotary->pretty();
// (123) 456-7890
```

This can be useful if you want access to several formats on one number.

> You can put any non-digit characters you like in your argument and Rotary will simply ignore them--it cares only for digits. `234-5678` and `2dfsad__34-5)(6=78` are identical so far as it's concerned.

**Note:** Rotary will try to interpret strange arguments, but it has limits, so please try to pass it numbers that make sense. 🙏

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~199 days

Total

5

Last Release

1687d ago

Major Versions

1.2.0 → 2.02021-10-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/45ef59bc24058cd989f522d8a6f8cc9b9aa31721b765d2b8552500dcc268e15d?d=identicon)[alwaysblank](/maintainers/alwaysblank)

---

Top Contributors

[![alwaysblank](https://avatars.githubusercontent.com/u/23412884?v=4)](https://github.com/alwaysblank "alwaysblank (19 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alwaysblank-rotary/health.svg)

```
[![Health](https://phpackages.com/badges/alwaysblank-rotary/health.svg)](https://phpackages.com/packages/alwaysblank-rotary)
```

PHPackages © 2026

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