2017 © Pedro Peláez
 

library value-object

Abstract value object implementation as basis for custom domain value objects.

image

fleshgrinder/value-object

Abstract value object implementation as basis for custom domain value objects.

  • Sunday, September 27, 2015
  • by Fleshgrinder
  • Repository
  • 1 Watchers
  • 2 Stars
  • 40 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Build Status Code Climate Test Coverage SensioLabsInsight Packagist Packagist License VersionEye, (*1)

Value Object

Abstract value object package that contains the building blocks to create custom domain value objects., (*2)

Install

Open a terminal, enter your project directory and execute the following command to add this package to your dependencies:, (*3)

$ composer require fleshgrinder/value-object

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*4)

Usage

There are two abstract classes and one interface in the source directory that can be used to build custom domain value objects tailored to the needs of a project. The provided ValueObject interface is a head interface that combines some interfaces to adhere to a contract of common methods that every value object should provide. Implementation of this interface is recommended for totally custom behavior., (*5)

The SingleValueObject is the perfect base for building value objects that are representable by a single value. Simply extend the abstract class and implement the necessary abstract methods and it should work out of the box. You may also extend the SingleValueObjectTest and override the getInstance, getDefaultValue, and getDefaultUnequalValue methods for a thorough test of your custom single valued value object., (*6)

The MultiValueObject is the perfect base for building value objects that represent multiple values. However, it only implements the equals method that ensures that the given value is of the same instance and delegates further checks to the extending child class. Multi valued value objects are complex and it is not possible to implement an abstraction that fits all requirements. You may also simply implement the interface and implement the instance of check yourself if you want., (*7)

License

MIT License, (*8)

The Versions

27/09 2015

dev-master

9999999-dev

Abstract value object implementation as basis for custom domain value objects.

  Sources   Download

MIT

The Requires

 

The Development Requires

25/09 2015

v0.0.0

0.0.0.0

Abstract value object implementation as basis for custom domain value objects.

  Sources   Download

MIT

The Requires

 

The Development Requires