PHPackages                             warriorgod/php-number-range-string - 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. warriorgod/php-number-range-string

ActiveLibrary

warriorgod/php-number-range-string
==================================

Support calculations on day ranges (e.g. 1-2, 4, ...)

v1.0.0(9y ago)0291MITPHP

Since Apr 6Pushed 9y ago1 watchersCompare

[ Source](https://github.com/warriorGod/php-number-range-string)[ Packagist](https://packagist.org/packages/warriorgod/php-number-range-string)[ RSS](/packages/warriorgod-php-number-range-string/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (2)Used By (1)

php-number-range-string
=======================

[](#php-number-range-string)

Generate and modify number ranges in a string format.

Features
========

[](#features)

- number ranges can be defined as a string, array or number (e.g. 3 as a single day range)
- ranges can be negative
- only tested on growing ranges (e.g from &lt;= to)
- separator is "-" by default, but can be configured in array notation and when parsing.

Usage
=====

[](#usage)

Please see tests for some examples. Here are a few.

```
NumberRangeString::fromRange('1-5')->moveBy(2) // 3-7
NumberRangeString::fromRange('1-20')->expand(new NumberRangeString('5-21')) // 1-21
NumberRangeString::fromRange('1-2')->countInclusive() // 2
NumberRangeString::fromRange('1-2')->countExclusive() // 0
NumberRangeString::fromRange('1-2')->countNumeric() // 1
NumberRangeString::fromRange('1-1')->countNumeric() // 0
NumberRangeString::fromRange('-5--1')->moveTo(1) // 1-5
new NumberRangeString([5,10, ' to ']) // 5 to 10
NumberRangeString::fromRange([5,10, ' to '])->add(1) // 6 to 11

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Unknown

Total

1

Last Release

3325d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1fe2f113571d1ed583479addd0f27c5fcd512cef30964aa45062272831293b77?d=identicon)[warriorGod](/maintainers/warriorGod)

---

Top Contributors

[![warriorGod](https://avatars.githubusercontent.com/u/1256979?v=4)](https://github.com/warriorGod "warriorGod (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/warriorgod-php-number-range-string/health.svg)

```
[![Health](https://phpackages.com/badges/warriorgod-php-number-range-string/health.svg)](https://phpackages.com/packages/warriorgod-php-number-range-string)
```

PHPackages © 2026

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