2017 © Pedro Pelรกez
 

library php_value_objects

A set of value objects to manage simple and composite values

image

serendipity_hq/php_value_objects

A set of value objects to manage simple and composite values

  • Friday, June 1, 2018
  • by Aerendir
  • Repository
  • 0 Watchers
  • 5 Stars
  • 2,626 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 4 Open issues
  • 67 Versions
  • 8 % Grown

The README.md

, (*1)

Serendipity HQ Value Objects

A set of PHP Value Objects to manage simple and composite values., (*2)

, (*3)

Supports: , (*4)

Tested with: , (*5)

, (*6)

Current Status

Coverage Maintainability Rating Quality Gate Status Reliability Rating Security Rating Technical Debt Vulnerabilities, (*7)

Phan PHPStan PSalm PHPUnit Composer PHP CS Fixer Rector, (*8)

Features

It supports SimpleValueObjects and ComplexValueObjects., (*9)

Complex value objects are hydrated passing an array. If a key of the array isn't recognized as property of the object it is added to the $otherData array so it isn't lost., (*10)

Some of those value objects support also the persistence in Doctrine providing custom mapping types (See below)., (*11)


Do you like this library?
LEAVE A โ˜…

or run
composer global require symfony/thanks && composer thanks
to say thank you to all libraries you use in your current project, this included! , (*12)


What are Value Objects

Value Objects are PHP objects that represent and manage simple or complex values. Once set, the value object cannot be modified without changing its identity., (*13)

Simple value objects represent a simple value, like an email. Complex value objects represent complex values, that, in order to really represent a value, need more than one value, like a price that needs an amount and a currency to be understandable and have a sense., (*14)

PHP supports only one value object: the DateTime object., (*15)

This library gives support for other kind of values, differentiating them between complex and simple., (*16)

To better understand the concepts behind the value objects, you can read this post., (*17)

Install component-value-objects via Composer

$ composer require serendipity_hq/component-value-objects

This library follows the http://semver.org/ versioning conventions., (*18)

Instructions to install Intl PHP extension in MAMP for Mac, (*19)

Available Value Objects

Currently, this library supports the following Value Objects:, (*20)

Supported features

ValueObject Doctrine Symfony
Embeddable Type Form Type Twig filter
Address โœ“ โœ• โœ“ โœ•
Currency N/A โœ“ โœ• โœ•
CurrencyExchangeRate N/A N/A N/A N/A
Email N/A โœ“ N/A N/A
IP N/A N/A N/A N/A
Money N/A โœ“ โœ“ โœ“
Payment โœ• โœ• โœ• โœ•
Phone โœ• โœ• โœ• โœ•
Tax โœ• โœ• โœ• โœ•
Uri โœ• โœ“ โœ• โœ•
VAT Rate โœ• โœ• โœ• โœ•
VAT Number โœ• โœ• โœ• โœ•

Do you like this library?
LEAVE A โ˜…

or run
composer global require symfony/thanks && composer thanks
to say thank you to all libraries you use in your current project, this included! , (*21)


The Versions