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 today

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 41% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

571d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5700620?v=4)[Steef Min](/maintainers/steefmin)[@steefmin](https://github.com/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)
```

###  Alternatives

[davidrjonas/composer-lock-diff

See what has changed after a composer update.

2852.0M11](/packages/davidrjonas-composer-lock-diff)[cheesegrits/filament-google-maps

A Google Maps package for Filament PHP with field, column and widget

325651.5k2](/packages/cheesegrits-filament-google-maps)[smuuf/primi

A scripting language written in PHP &amp; executable within PHP.

13378.6k](/packages/smuuf-primi)[helis/settings-manager-bundle

Provides a nice way to define variables and inject them into application parts

3072.6k](/packages/helis-settings-manager-bundle)

PHPackages © 2026

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