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

ActiveValue-object

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 1mo ago

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 37% 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

1207d 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.8k82.5M421](/packages/moneyphp-money)[darsyn/ip

An immutable IP Address value object that provides several different notations, including helper functions.

2572.0M20](/packages/darsyn-ip)[ulabox/money

Yet another PHP implementation of the Money value object using BCMath

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

A small library to handle currencies and money values

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

PHP primitive types value objects.

3435.2k1](/packages/gowork-values)[yokai/doctrine-value-object

Value Objects for Doctrine ORM simplified

1330.4k1](/packages/yokai-doctrine-value-object)

PHPackages © 2026

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