PHPackages                             jeckel-lab/identity-contract - 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. jeckel-lab/identity-contract

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

jeckel-lab/identity-contract
============================

Contract and abstract classes to manage identities in Domains

v2.0.0(2y ago)1384[2 issues](https://github.com/Jeckel-Lab/identity-contract/issues)[3 PRs](https://github.com/Jeckel-Lab/identity-contract/pulls)MITPHPPHP &gt;=8.2

Since Mar 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Jeckel-Lab/identity-contract)[ Packagist](https://packagist.org/packages/jeckel-lab/identity-contract)[ RSS](/packages/jeckel-lab-identity-contract/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (6)Dependencies (14)Versions (11)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/98590cbd7594ebb720ebbc442fe110e2db13606a3c1b499f10923dbb9692dd2f/68747470733a2f2f706f7365722e707567782e6f72672f6a65636b656c2d6c61622f6964656e746974792d636f6e74726163742f762f737461626c65)](https://packagist.org/packages/jeckel-lab/identity-contract)[![Total Downloads](https://camo.githubusercontent.com/33f62ff6b2b1679725c65cbaec96748922831e8809ca1fca2b35cf22a4b10eb6/68747470733a2f2f706f7365722e707567782e6f72672f6a65636b656c2d6c61622f6964656e746974792d636f6e74726163742f646f776e6c6f616473)](https://packagist.org/packages/jeckel-lab/identity-contract)[![Build Status](https://github.com/jeckel-lab/identity-contract/workflows/validate/badge.svg)](https://github.com/Jeckel-Lab/identity-contract/actions)[![codecov](https://camo.githubusercontent.com/396f1f5375ae39cb85cae73c3e0d6b194429861d03fdea492382fad1813fa797/68747470733a2f2f636f6465636f762e696f2f67682f4a65636b656c2d4c61622f6964656e746974792d636f6e74726163742f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d756e304e5a7133487569)](https://codecov.io/gh/Jeckel-Lab/identity-contract)[![Mutation testing badge](https://camo.githubusercontent.com/ea4b915641f9fa8a3af41da699c5bcc7c414f0a39cb8a8fce9e99e047b247f06/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532464a65636b656c2d4c61622532466964656e746974792d636f6e74726163742532466d61696e)](https://dashboard.stryker-mutator.io/reports/github.com/Jeckel-Lab/identity-contract/main)

Identity-contract
=================

[](#identity-contract)

PHP VersionPackage versionPHP &gt;= 8.2v2.0PHP &gt;= 8.0v1.1This package propose abstract classes to manage Identities in DDD projects.

Features
--------

[](#features)

Builtin typed identities :

- integer based identities
- string based identities
- uuid based identities

Also:

- instance are readonly
- equality test
- request same identity twice return same object

Usage
-----

[](#usage)

**Int Identity**

```
final readonly class CarId extends AbstractIntIdentity {}

$id = CarId::from(25);
```

**UUID Identity**

```
use JeckelLab\IdentityContract\AbstractUuidIdentity;

final readonly class UserId extends AbstractUuidIdentity {}

$id = UserId::from("d2fbc6c0-0497-42f1-8ece-8840641b67f0");

// or

$id = UserId::new();

// Generating twice same identity return same object

$id1 = UserId::from("d2fbc6c0-0497-42f1-8ece-8840641b67f0");
$id2 = UserId::from("d2fbc6c0-0497-42f1-8ece-8840641b67f0");

var_dump($id1 === $id2); // true
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 98.2% 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 ~190 days

Recently: every ~235 days

Total

6

Last Release

939d ago

Major Versions

v0.2.1 → v1.0.02021-07-06

v1.1.0 → v2.0.02023-10-16

PHP version history (4 changes)v0.1.0PHP ^7.2 || ^8.0

v1.0.0PHP ^8.0

v1.1.0PHP &gt;=8.0

v2.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/57215536?v=4)[Jeckel-Lab](/maintainers/jeckel-lab)[@Jeckel-Lab](https://github.com/Jeckel-Lab)

---

Top Contributors

[![jeckel](https://avatars.githubusercontent.com/u/2981531?v=4)](https://github.com/jeckel "jeckel (54 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

contractcontractsdddidentityphpphp-library

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jeckel-lab-identity-contract/health.svg)

```
[![Health](https://phpackages.com/badges/jeckel-lab-identity-contract/health.svg)](https://phpackages.com/packages/jeckel-lab-identity-contract)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k74.6k86](/packages/pocketmine-pocketmine-mp)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[getdkan/dkan

DKAN Open Data Catalog

385135.4k2](/packages/getdkan-dkan)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[tomaj/hermes

Simple php background processing library

38251.0k5](/packages/tomaj-hermes)

PHPackages © 2026

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