{"id":19210656,"url":"https://github.com/mhndev/value-objects","last_synced_at":"2025-05-12T19:24:33.606Z","repository":{"id":62527815,"uuid":"82322325","full_name":"mhndev/value-objects","owner":"mhndev","description":"common value Objects such as Email and Phone , ...","archived":false,"fork":false,"pushed_at":"2018-11-20T14:22:05.000Z","size":27,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2024-05-04T09:00:46.185Z","etag":null,"topics":["value-object"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhndev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-17T17:38:58.000Z","updated_at":"2023-08-27T18:34:45.000Z","dependencies_parsed_at":"2022-11-02T14:30:21.468Z","dependency_job_id":null,"html_url":"https://github.com/mhndev/value-objects","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhndev%2Fvalue-objects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhndev%2Fvalue-objects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhndev%2Fvalue-objects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhndev%2Fvalue-objects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhndev","download_url":"https://codeload.github.com/mhndev/value-objects/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223833744,"owners_count":17210915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["value-object"],"created_at":"2024-11-09T13:36:45.028Z","updated_at":"2024-11-09T13:36:45.878Z","avatar_url":"https://github.com/mhndev.png","language":"PHP","readme":"# Common Value Objects\n\n##### Common mostly used Value Objects I confronted through my own Projects\n\n\n##### sample codes\n\n```php\n\nuse mhndev\\valueObjects\\implementations\\Email;\nuse mhndev\\valueObjects\\implementations\\MobilePhone;\nuse mhndev\\valueObjects\\implementations\\Token;\nuse mhndev\\valueObjects\\implementations\\Version;\n\n$mobileObject = MobilePhone::fromOptions('989124444444');\n\necho $mobileObject-\u003eformat(MobilePhone::WithZero);\n\n### output : 09124444444\n\necho $mobileObject-\u003eformat(MobilePhone::WithoutZero);\n\n### output : 9124444444\n\necho $mobileObject-\u003eisMCI(MobilePhone::WithoutZero);\n\n### output : true\n\necho $mobileObject-\u003eisMTN(MobilePhone::WithoutZero);\n\n### output : false\n\n$emailObject = new Email('info@example.com');\n\necho $emailObject-\u003egetDomain();\n\n### output : example.com\n\necho $emailObject-\u003egetLocal();\n\n### output : info\n\n\n$tokenObject = new Token(\n    'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImVhMTY3OTQ',\n    Token::SCHEMA_Bearer,\n    6000\n);\n\necho $tokenObject-\u003egetType();\n\n### output : Bearer\n\necho $tokenObject-\u003egetExpiresAt()-\u003eformat('Y-m-d H:i:s');\n\n### output : 2018-12-03 08:05:22\n\n\n$port = Version::fromString('6.5.0');\n\n\necho $port-\u003egetMajor();\n### output : 6\n\n\necho $port-\u003egetMinor();\n### output : 0\n\n\necho $port-\u003egetPatch();\n### output : 5\n\n\n```\n\n#### you can find more examples by digging in source.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhndev%2Fvalue-objects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhndev%2Fvalue-objects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhndev%2Fvalue-objects/lists"}