{"id":24258218,"url":"https://github.com/jgimeno/value-objects","last_synced_at":"2025-06-16T22:33:08.864Z","repository":{"id":56998664,"uuid":"81983115","full_name":"jgimeno/value-objects","owner":"jgimeno","description":"Ultimate Collection of PHP Value Objects to use on your projects.","archived":false,"fork":false,"pushed_at":"2017-02-27T16:26:33.000Z","size":63,"stargazers_count":7,"open_issues_count":3,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-03T18:30:21.326Z","etag":null,"topics":["domain-driven-design","php7","value-object"],"latest_commit_sha":null,"homepage":"","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/jgimeno.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-14T19:53:28.000Z","updated_at":"2022-02-12T10:51:12.000Z","dependencies_parsed_at":"2022-08-21T11:10:20.486Z","dependency_job_id":null,"html_url":"https://github.com/jgimeno/value-objects","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/jgimeno/value-objects","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgimeno%2Fvalue-objects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgimeno%2Fvalue-objects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgimeno%2Fvalue-objects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgimeno%2Fvalue-objects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgimeno","download_url":"https://codeload.github.com/jgimeno/value-objects/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgimeno%2Fvalue-objects/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260251940,"owners_count":22981162,"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":["domain-driven-design","php7","value-object"],"created_at":"2025-01-15T05:31:59.574Z","updated_at":"2025-06-16T22:33:08.823Z","avatar_url":"https://github.com/jgimeno.png","language":"PHP","readme":"[![Build Status](https://travis-ci.org/jgimeno/value-objects.svg?branch=master)](https://travis-ci.org/jgimeno/value-objects)\n[![Coverage Status](https://coveralls.io/repos/github/jgimeno/value-objects/badge.svg?branch=master)](https://coveralls.io/github/jgimeno/value-objects?branch=master)\n[![Code Climate](https://codeclimate.com/github/jgimeno/value-objects/badges/gpa.svg)](https://codeclimate.com/github/jgimeno/value-objects)\n# Ultimate PHP Value Object Collection\nCollection of PHP value objects to use and extend as building blocks for DDD.\n\nThis library comes with the idea of having a starting point for defining \nvalue objects for different projects.\n\nAll the value objects are inmutable.\n\n## How to install\n\nYou can get it using composer:\n\n    composer require jgimeno/value-objects\n\n## How to use\n\n### Base objects\n\nThe idea of this library is to have a collection of objects as a \nbase for the creation of your Domain.\n\nThe most basic object is the `ValueObject` which we can extend all \nthe value objects we want to create from.\nBase `ValueObject` implements `__toString()` and `equals()` methods (i.e. you get them \nfor free).\n\nIf we know that our value objects will benefit from the methods included in the\nobjects `Strings`, `Number` or `Boolean`, we can extend from there. \n\n### Rationale\nImagine that I create an object called `SonName` that our domain needs. \nIn that case it could be useful to extend from `Strings` and we will \nhave methods like `toUpperCase()`, `trim()`, etc that we can reuse. \nYou get the idea.\n\nLastly there is another base object called `Identifier`. This is useful when \ncreating ids, for example, a `UserId` can extend from `Identifier`. \nThen we can do `UserId::generate()` and we will have a unique \n`userId` generated using UUIDs.\n\n### Useful objects\n`Internet\\Email`: Object representing an email address, it throws exceptions \nwhen given email is not a valid email.\n\n`Internet\\IpAddress`: Object that represents an IP address, it throws exception \nwhen is not a valid ip address.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgimeno%2Fvalue-objects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgimeno%2Fvalue-objects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgimeno%2Fvalue-objects/lists"}