PHPackages                             lhellemons/php-value-objects - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. lhellemons/php-value-objects

ActiveLibrary

lhellemons/php-value-objects
============================

Classes, traits and interfaces for implementing true PHP value objects

1.1.0(7y ago)28592[2 issues](https://github.com/lhellemons/php-value-objects/issues)MITPHPPHP ^7.1

Since Nov 12Pushed 4y ago4 watchersCompare

[ Source](https://github.com/lhellemons/php-value-objects)[ Packagist](https://packagist.org/packages/lhellemons/php-value-objects)[ RSS](/packages/lhellemons-php-value-objects/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (6)Dependencies (1)Versions (9)Used By (0)

PHP Value Objects SDK
=====================

[](#php-value-objects-sdk)

[![Build Status](https://camo.githubusercontent.com/ceed4ea48279d54d0568a96e7675d5f516cf3f0b6346c68f5f94ee542f30d4f6/68747470733a2f2f7472617669732d63692e6f72672f6c68656c6c656d6f6e732f7068702d76616c75652d6f626a656374732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/lhellemons/php-value-objects)

Author: Laurens Hellemons

This library contains utility classes, traits and interfaces for working with value objects in PHP. By using these, you can easily define your own value objects.

Read the full documentation [here](docs/index.md).

Why value objects?
------------------

[](#why-value-objects)

Value objects are a core component of domain-driven design (DDD). They are objects that do not have an identity, and are instead defined by their values. Any large system that deals with domain concepts will eventually develop a need to model some of these concepts as value objects. Examples of such concepts include

- Dates
- Amounts of money
- Coordinates
- Adresses
- Physical quantities such as age, length or weight

This library helps circumvent PHP's limited support for value objects. Using the classes, interfaces and traits provided by this package, you can create your own value objects without worrying about the internals.

Usage
-----

[](#usage)

Install the package using composer.

```
composer require lhellemons/php-value-objects
```

Then, use the classes or traits in your own designs.

```
