{"id":18565572,"url":"https://github.com/jeckel-lab/identity-contract","last_synced_at":"2025-06-13T20:36:30.886Z","repository":{"id":45176846,"uuid":"346042108","full_name":"Jeckel-Lab/identity-contract","owner":"Jeckel-Lab","description":"Propose basic abstract classes to manage Identities in Domain project","archived":false,"fork":false,"pushed_at":"2024-03-04T07:04:52.000Z","size":74,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T19:09:18.234Z","etag":null,"topics":["contract","contracts","ddd","identity","php","php-library"],"latest_commit_sha":null,"homepage":"https://jeckel-lab.fr","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jeckel-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-09T14:53:56.000Z","updated_at":"2023-10-16T15:42:52.000Z","dependencies_parsed_at":"2025-05-15T19:09:20.236Z","dependency_job_id":null,"html_url":"https://github.com/Jeckel-Lab/identity-contract","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeckel-Lab%2Fidentity-contract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeckel-Lab%2Fidentity-contract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeckel-Lab%2Fidentity-contract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeckel-Lab%2Fidentity-contract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jeckel-Lab","download_url":"https://codeload.github.com/Jeckel-Lab/identity-contract/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254404346,"owners_count":22065641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contract","contracts","ddd","identity","php","php-library"],"created_at":"2024-11-06T22:19:26.656Z","updated_at":"2025-05-15T19:09:59.021Z","avatar_url":"https://github.com/Jeckel-Lab.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/jeckel-lab/identity-contract/v/stable)](https://packagist.org/packages/jeckel-lab/identity-contract)\n[![Total Downloads](https://poser.pugx.org/jeckel-lab/identity-contract/downloads)](https://packagist.org/packages/jeckel-lab/identity-contract)\n[![Build Status](https://github.com/jeckel-lab/identity-contract/workflows/validate/badge.svg)](https://github.com/Jeckel-Lab/identity-contract/actions)\n[![codecov](https://codecov.io/gh/Jeckel-Lab/identity-contract/branch/main/graph/badge.svg?token=un0NZq3Hui)](https://codecov.io/gh/Jeckel-Lab/identity-contract)\n[![Mutation testing badge](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FJeckel-Lab%2Fidentity-contract%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/Jeckel-Lab/identity-contract/main)\n\n# Identity-contract\n\n| PHP Version | Package version | \n| ---------- | ---------------- |\n| PHP \u003e= 8.2 | v2.0 |\n| PHP \u003e= 8.0 | v1.1 |\n\nThis package propose abstract classes to manage Identities in DDD projects.\n\n## Features\n\nBuiltin typed identities :\n- integer based identities\n- string based identities\n- uuid based identities\n\nAlso:\n- instance are readonly\n- equality test\n- request same identity twice return same object\n\n## Usage\n\n**Int Identity**\n```PHP\nfinal readonly class CarId extends AbstractIntIdentity {}\n\n$id = CarId::from(25);\n```\n\n**UUID Identity**\n```PHP\nuse JeckelLab\\IdentityContract\\AbstractUuidIdentity;\n\nfinal readonly class UserId extends AbstractUuidIdentity {}\n\n$id = UserId::from(\"d2fbc6c0-0497-42f1-8ece-8840641b67f0\");\n\n// or\n\n$id = UserId::new();\n\n// Generating twice same identity return same object\n\n$id1 = UserId::from(\"d2fbc6c0-0497-42f1-8ece-8840641b67f0\");\n$id2 = UserId::from(\"d2fbc6c0-0497-42f1-8ece-8840641b67f0\");\n\nvar_dump($id1 === $id2); // true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeckel-lab%2Fidentity-contract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeckel-lab%2Fidentity-contract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeckel-lab%2Fidentity-contract/lists"}