Skip to content

A set of generic value objects to be used in PHP projects

License

Notifications You must be signed in to change notification settings

KickAssCommerce/valueobjects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ValueObjects

Build Status

Please note: this project is, for now, in alpha while I try to figure out what works best

A set of common value objects.

Types are grouped by categories like Identity. Each object extends a scalar type for basic validation and return type enforcing

Usage

use KickAss\ValueObjects\Identity\EmailValue;
use KickAss\ValueObjects\ValidationException;

try {
   $value = new EmailValue('test@example.com');
} catch(ValidationException $error) {
   // handle the exception for invalid values
}

echo $value->value();
echo (string)$value;

Outputs

test@example.com
test@example.com

Installation

Install module via composer

Contributing

I would love to have some help on this project. With PRs, bug reporting or just give your opinion on how this could be improved via a feature issue.

About

A set of generic value objects to be used in PHP projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages