{"id":22982326,"url":"https://github.com/reload/cpr","last_synced_at":"2026-05-08T23:20:41.640Z","repository":{"id":266436198,"uuid":"897753043","full_name":"reload/cpr","owner":"reload","description":"Danish civil registration numbers (CPR) in PHP","archived":false,"fork":false,"pushed_at":"2026-04-17T21:18:30.000Z","size":477,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-17T23:29:05.720Z","etag":null,"topics":["civil-registration","cpr-nummer","denmark","personal-identification-number","php","php-library"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/reload/cpr","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reload.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-03T07:15:32.000Z","updated_at":"2026-04-17T21:18:20.000Z","dependencies_parsed_at":"2025-12-14T03:05:36.237Z","dependency_job_id":null,"html_url":"https://github.com/reload/cpr","commit_stats":null,"previous_names":["reload/cpr"],"tags_count":158,"template":false,"template_full_name":null,"purl":"pkg:github/reload/cpr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fcpr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fcpr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fcpr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fcpr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reload","download_url":"https://codeload.github.com/reload/cpr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fcpr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32402785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["civil-registration","cpr-nummer","denmark","personal-identification-number","php","php-library"],"created_at":"2024-12-15T02:17:56.696Z","updated_at":"2026-04-28T23:08:12.876Z","avatar_url":"https://github.com/reload.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CprNumber\n\nA class representing Danish civil registration numbers (CPR\nnumbers).\n\nThe CPR number is a ten digit number with the format DDMMYY-SSSS, where\nthe first six digits represent the date of birth and the last four digits\nare a sequence number.\n\nThe CPR number is used in Denmark to uniquely identify persons in\nvarious systems, and is also used as a personal identification number\nin many contexts.\n\nThe class represents a CPR number as a read-only value object, and\nprovides methods for working with, formatting, and validating CPR\nnumbers.\n\n* Full name: `\\Reload\\Cpr\\CprNumber`\n\n## Methods\n\n### __construct\n\nConstruct a CPR number readonly value object from a string.\n\n```php\npublic __construct(string $cpr)\n```\n\n**Parameters:**\n\n| Parameter | Type       | Description                   |\n|-----------|------------|-------------------------------|\n| `$cpr`    | **string** | A string with the CPR number. |\n\n**Throws:**\n\nIf the CPR number does not\ncontain 10 digits\n- [`InvalidCprNumberFormat`](src/Exception/InvalidCprNumberFormat.php)\nIf the date in the CPR number doesn't\nexist.\n- [`NonExistingDate`](src/Exception/NonExistingDate.php)\n\n### __toString\n\nFormat the CPR number in the traditional format (120345-6789).\n\n```php\npublic __toString(): string\n```\n\n**See Also:**\n\n* \\Reload\\Cpr\\CprNumber::formatPretty()\n\n### formatPretty\n\nFormat the CPR number in the traditional format (120345-6789).\n\n```php\npublic formatPretty(): string\n```\n\n### formatNumbersOnly\n\nFormat the CPR number using numbers only (1203456789).\n\n```php\npublic formatNumbersOnly(): string\n```\n\n### isFemale\n\nCheck if the CPR number represents a female person.\n\n```php\npublic isFemale(): bool\n```\n\n### isMale\n\nCheck if the CPR number represents a male person.\n\n```php\npublic isMale(): bool\n```\n\n### getDateTimeImmutable\n\nGet a DateTimeImmutable object from the CPR number.\n\n```php\npublic getDateTimeImmutable(?\\DateTimeZone $timezone = null): ?\\DateTimeImmutable\n```\n\n**Parameters:**\n\n| Parameter   | Type               | Description                                                                  |\n|-------------|--------------------|------------------------------------------------------------------------------|\n| `$timezone` | **?\\DateTimeZone** | A DateTimeZone object for the desired time zone. Defaults: current timezone. |\n\n### validateModulus11\n\nValidate the CPR number using the modulus 11 algorithm.\n\n```php\npublic validateModulus11(): bool\n```\n\nNOTICE: CPR numbers are no longer required to fulfill the modulus\n11 check. You should NOT use this method to validate or dismiss\nCPR numbers.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freload%2Fcpr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freload%2Fcpr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freload%2Fcpr/lists"}