Skip to content

Repository files navigation

getwarp/value-object

Value Object library for PHP

GitHubPackagistInstallationUsage

Installation

Via Composer

$ composer require getwarp/value-object

Usage

useWarp\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);

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Report issues and send pull requests in the main Warp repository. Please see contributing guide and code of conduct for details.

Credits

License

The MIT License (MIT). Please see license file for more information.

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages