Via Composer
$ composer require getwarp/value-objectuseWarp\ValueObject\AbstractIntValue;
useWarp\ValueObject\AbstractEnumValue;
class PostId extends AbstractIntValue {
}
$postId = PostId::new(10);
\assert($int->value() === 10);
\assert(PostId::new(10) === $postId);
/** * @method static self public() * @method static self draft() */class PostStatus extends AbstractEnumValue {
publicconstPUBLIC = 'public';
publicconstDRAFT = 'draft';
}
$draftStatus = PostStatus::draft();
$publicStatus = PostStatus::public();
\assert($draftStatus !== $publicStatus);Please see CHANGELOG for more information on what has changed recently.
Report issues and send pull requests in the main Warp repository. Please see contributing guide and code of conduct for details.
The MIT License (MIT). Please see license file for more information.