Skip to content

Commit

Permalink
Merge pull request #19 from Jeckel-Lab/feature/update-readme
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
jeckel authored Oct 16, 2023
2 parents 3a73181 + c0ac8b9 commit c8b45e6
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 4 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"

- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,26 @@

# Identity-contract

**Require PHP >= 8.0**
| PHP Version | Package version |
| ---------- | ---------------- |
| PHP >= 8.2 | v2.0 |
| PHP >= 8.0 | v1.1 |

Propose basic abstract classes to manage Identities in Domain project.
This package propose abstract classes to manage Identities in DDD projects.

## Features

Builtin typed identities :
- integer based identities
- string based identities
- uuid based identities

# Usage
Also:
- instance are readonly
- equality test
- request same identity twice return same object

## Usage

**Int Identity**
```PHP
Expand All @@ -34,5 +45,11 @@ $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
```

0 comments on commit c8b45e6

Please sign in to comment.