https://github.com/kickasscommerce/valueobjects
A set of generic value objects to be used in PHP projects
https://github.com/kickasscommerce/valueobjects
Last synced: 2 months ago
JSON representation
A set of generic value objects to be used in PHP projects
- Host: GitHub
- URL: https://github.com/kickasscommerce/valueobjects
- Owner: KickAssCommerce
- License: mit
- Created: 2017-08-28T08:55:01.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-29T13:08:30.000Z (almost 9 years ago)
- Last Synced: 2025-01-16T01:15:00.961Z (over 1 year ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ValueObjects
[](https://travis-ci.org/KickAssCommerce/valueobjects)
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.