PHPackages                             davidschwarz/line-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. davidschwarz/line-number

ActiveValue-object[Utility &amp; Helpers](/categories/utility)

davidschwarz/line-number
========================

Line numbers as immutable value objects. With a WeakMap based repository in the background.

v1.0.3(3y ago)04MITPHPPHP 8.2.\*

Since Jan 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/d4s6/LineNumber)[ Packagist](https://packagist.org/packages/davidschwarz/line-number)[ Docs](https://github.com/d4s6/LineNumber)[ RSS](/packages/davidschwarz-line-number/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

Line number
===========

[](#line-number)

Line numbers as *immutable* value objects.
With a [WeakMap](https://www.php.net/WeakMap) based repository in the background.

installation
------------

[](#installation)

```
composer require davidschwarz/line-number
```

example
-------

[](#example)

```
require __DIR__ . '/vendor/autoload.php';

use DavidSchwarz\LineNumber\Line;

$startLine = Line::number(0);
$otherLine = $startLine->add(2);

$otherLine->equals($startLine); // FALSE
$otherLine->equals(2);          // TRUE

(string) Line::number(7);       // '7'
Line::number(7)->i;             // 7

Line::number(-1);               // throws ...\NegativeValueError

Line::number(0)->subtract(2);   // throws ...\NegativeResultError
```

license
-------

[](#license)

[MIT License](LICENSE.txt)

author
------

[](#author)

[David Schwarz / Ringsdorf](https://davidschwarz.eu/)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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

Every ~1 days

Total

4

Last Release

1262d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b7906f7136b92348b6268767bc9a87e0cd2cc37304b9b8b5a6c87ee16e8fea4?d=identicon)[d4s6](/maintainers/d4s6)

---

Top Contributors

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

---

Tags

Value Objectline number

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/davidschwarz-line-number/health.svg)

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

###  Alternatives

[moneyphp/money

PHP implementation of Fowler's Money pattern

4.8k91.5M525](/packages/moneyphp-money)[ulabox/money

Yet another PHP implementation of the Money value object using BCMath

79242.9k](/packages/ulabox-money)[adsmurai/currency

A small library to handle currencies and money values

4443.1k](/packages/adsmurai-currency)[gowork/values

PHP primitive types value objects.

3336.9k2](/packages/gowork-values)[money/money

PHP implementation of Fowler's Money pattern

1092.7k1](/packages/money-money)[dykyi-roman/awesome-claude-code

Claude Code extension for PHP: audits (architecture, DDD, security, performance, PSR, design patterns, Docker, CI/CD, tests, docs), 3-level code review, automated bug fix, generators (DDD, CQRS, GoF patterns, PSR, tests, documentation, Docker, CI/CD), code explanation, refactoring. 26 commands, 62 agents, 259 skills.

851.2k](/packages/dykyi-roman-awesome-claude-code)

PHPackages © 2026

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