/embeddables

Small collection of value objects.

Primary LanguagePHPMIT LicenseMIT

Embeddables library

Latest Version License Build Status Coverage Status Code quality

Small collection of Value Objects to ease composition.

Install

Via Composer

$ composer require gentle/embeddables

Usage

use Gentle\Embeddable\Date;
use Gentle\Embeddable\Time;

$date = new Date(
    new Date\Year(2016),
    new Date\Month(12),
    new Date\Day(25)
);
echo (string)$date; // 2016-12-25

$time = new Time(
    new Time\Hour(23),
    new Time\Minute('04'),
    new Time\Second(14)
);

// changing timezone will return a new `Time` object
$time = $time->withTimeZone(new \DateTimeZone('Europe/Monaco'));
echo (string)$time; // 23:04:14

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

For any security related issues, please send an email at alex@gentle.ro instead of using the issue tracker.

License

Licensed under the MIT License - see the LICENSE file for details.