Skip to content

Commit

Permalink
Merge pull request #66 from Johannestegner/hotfix/get-age
Browse files Browse the repository at this point in the history
Fix GetAge with negative values.
Add Clock to abstract away DateTime.
  • Loading branch information
Johannestegner authored Jan 13, 2025
2 parents 443ca36 + b53804d commit 1be4bcb
Show file tree
Hide file tree
Showing 7 changed files with 528 additions and 279 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ composer require personnummer/personnummer
When a personnummer is invalid a PersonnummerException is thrown.

## Options
| Option | Type | Default | Description |
|-------------------------|:-----|:--------|:---------------------------:|
| allowCoordinationNumber | bool | true | Accept coordination numbers |
| allowInterimNumber | bool | false | Accept interim/T numbers |
| Option | Type | Default | Description |
|-------------------------|:-------------------------|:------------------------|:----------------------------------|
| allowCoordinationNumber | bool | true | Accept coordination numbers |
| allowInterimNumber | bool | false | Accept interim/T numbers |
| clock | Psr\Clock\ClockInterface | Personummer\SystemClock | Clock used for time calculations |

## Examples

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"issues": "https://github.com/personnummer/php/issues"
},
"require": {
"php": ">=8.1"
"php": ">=8.1",
"psr/clock": "1.0.0"
},
"require-dev": {
"ext-json": "*",
Expand Down
Loading

0 comments on commit 1be4bcb

Please sign in to comment.