Skip to content

Commit 1be4bcb

Browse files
Merge pull request #66 from Johannestegner/hotfix/get-age
Fix GetAge with negative values. Add Clock to abstract away DateTime.
2 parents 443ca36 + b53804d commit 1be4bcb

File tree

7 files changed

+528
-279
lines changed

7 files changed

+528
-279
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ composer require personnummer/personnummer
4141
When a personnummer is invalid a PersonnummerException is thrown.
4242

4343
## Options
44-
| Option | Type | Default | Description |
45-
|-------------------------|:-----|:--------|:---------------------------:|
46-
| allowCoordinationNumber | bool | true | Accept coordination numbers |
47-
| allowInterimNumber | bool | false | Accept interim/T numbers |
44+
| Option | Type | Default | Description |
45+
|-------------------------|:-------------------------|:------------------------|:----------------------------------|
46+
| allowCoordinationNumber | bool | true | Accept coordination numbers |
47+
| allowInterimNumber | bool | false | Accept interim/T numbers |
48+
| clock | Psr\Clock\ClockInterface | Personummer\SystemClock | Clock used for time calculations |
4849

4950
## Examples
5051

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"issues": "https://github.com/personnummer/php/issues"
3535
},
3636
"require": {
37-
"php": ">=8.1"
37+
"php": ">=8.1",
38+
"psr/clock": "1.0.0"
3839
},
3940
"require-dev": {
4041
"ext-json": "*",

0 commit comments

Comments
 (0)