PHPackages                             steefmin/immutable - 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. steefmin/immutable

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

steefmin/immutable
==================

PHP library to easily implement immutable objects

1.1.1(1y ago)01MITPHPPHP &gt;=8.1

Since Dec 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/steefmin/immutable)[ Packagist](https://packagist.org/packages/steefmin/immutable)[ RSS](/packages/steefmin-immutable/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

Immutable
=========

[](#immutable)

PHP library to easily implement immutable objects

---

```
use SteefMin\Immutable\Immutable;

/**
 * @method self withId(int $id)
 */
final class DTO
{
    use Immutable;

    public function __construct(
        private readonly int $id,
        private readonly string $value,
    ){
    }

    public function id(): int
    {
        return $this->id;
    }
}

$original = new DTO(1, 'one');

$updated = $original->with('id', 2);
// or
$updated = $original->withId(2);

echo $original->id(); // 1
echo $updated->id(); // 2
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Total

4

Last Release

525d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e80c3ce9501d882ffdfb27651f16b657490fd93ed1a3eb356dfabe1d8cc6b04?d=identicon)[steefmin](/maintainers/steefmin)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/steefmin-immutable/health.svg)

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

PHPackages © 2026

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