Skip to content

Commit

Permalink
Updated readme with documentation on the clock Option.
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
  • Loading branch information
Johannestegner committed Jan 13, 2025
1 parent ccb0c24 commit b53804d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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
2 changes: 1 addition & 1 deletion src/Personnummer.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private static function luhn(string $str): int
public function __construct(string $ssn, array $options = [])
{
$this->options = $this->parseOptions($options);
$this->clock = $this->options['clock'];
$this->clock = $this->options['clock'];
$this->parts = self::getParts($ssn);

// Sanity checks.
Expand Down

0 comments on commit b53804d

Please sign in to comment.