PHPackages                             aviator/prefixed-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. aviator/prefixed-number

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

aviator/prefixed-number
=======================

A value object for numbers with prefixes.

1.1.0(7y ago)14MITPHPPHP &gt;=7.2.0

Since Dec 14Pushed 7y ago2 watchersCompare

[ Source](https://github.com/danielsdeboer/prefixed-number)[ Packagist](https://packagist.org/packages/aviator/prefixed-number)[ Docs](https://github.com/danielsdeboer/prefixed-number)[ RSS](/packages/aviator-prefixed-number/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Overview
--------

[](#overview)

A simple class to manage prefixed numbers (eg `X99`) without relying on the `intl` extension.

### Installation

[](#installation)

Via Composer:

```
composer require aviator/prefixed-number

```

### Testing

[](#testing)

Via Composer:

```
composer test

```

### Usage

[](#usage)

Generally, you'll probably want to use `PrefixedNumber::parse($string)`. This will return a new `PrefixedNumber` instance.

You can also instantiate it normally:

```
$object = new PrefixedNumber($number, $prefix, $padding);
```

From there you can get a string representation of the object.

```
$object->value(); // returns a string representation of the object.
```

You can also easily increment or decrement it:

```
$object = new PrefixedNumber(99, 'X');

$incremented = $object->increment(); // Returns a new instance of PrefixedNumber
$decremented = $object->decrement(); // As does this

echo $object->value(); // 'X99'
echo $incremented->value(); // 'X100'
echo $decremented->value(); // 'X98'
```

You can also reset the number to 1:

```
$object = new PrefixedNumber(99, 'X');

$reset = $object->reset(); // Returns a new instance

echo $object->value(); // 'X99'
echo $reset->value(); // 'X1'
```

Other
-----

[](#other)

The parser implements `Aviator\Values\Interfaces\Parser`. You can change how this class works by implementing that interface and injecting it as the second parameter of the static parse method:

```
$valueObject = PrefixedNumber::parse('X99', new MyLittleParser());
```

### License

[](#license)

This package is licensed with the [MIT License (MIT)](LICENSE).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

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 ~32 days

Total

2

Last Release

2676d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ebd3fe214b5768e700ae43c7fdc4b83d249972a6a97a0faef372d0ec19256eca?d=identicon)[danielsdeboer](/maintainers/danielsdeboer)

---

Top Contributors

[![danielsdeboer](https://avatars.githubusercontent.com/u/13170241?v=4)](https://github.com/danielsdeboer "danielsdeboer (8 commits)")

---

Tags

phpstringsphp72

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aviator-prefixed-number/health.svg)

```
[![Health](https://phpackages.com/badges/aviator-prefixed-number/health.svg)](https://phpackages.com/packages/aviator-prefixed-number)
```

###  Alternatives

[doctrine/inflector

PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.

11.4k855.8M711](/packages/doctrine-inflector)[glowy/strings

Strings Component provide a fluent, object-oriented interface for working with multibyte string, allowing you to chain multiple string operations together using a more readable syntax compared to traditional PHP strings functions.

183.4k2](/packages/glowy-strings)

PHPackages © 2026

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