voku/value_objects
最新稳定版本:0.1.0
Composer 安装命令:
composer require voku/value_objects
包简介
Value Objects
README 文档
README
Value Objects
A collection of value objects that can help you to write more readable, self-validated and immutable code.
Install with Composer
composer require voku/value_objects
Usage
use voku\ValueObjects\ValueObjectVatPercentage; require_once __DIR__ . '/vendor/autoload.php'; // example path $vat = ValueObjectVatPercentage::create('16.0'); $vat->getGross(10.0)); // '11.6'
Unit Tests
- Composer is a prerequisite for running the tests.
composer install
- The tests can be executed by running this command from the root directory.
./vendor/bin/phpunit
AbstractHttpProvider methods
| create | createEmpty | decryptFromString | encrypt |
| jsonSerialize | value | valueOrFallback | valueOrThrowException |
create(\TCreateValue|null $value): static
Parameters:
\TCreateValue|null $value
Return:
static
createEmpty(): static
Parameters: nothing
Return:
static
decryptFromString(string $password, string $data): static
Parameters:
string $passwordstring $data
Return:
static
encrypt(string $password):
Parameters:
string $password
Return:
string
jsonSerialize(): string
Parameters: nothing
Return:
string
value(): TValue|null
↑ Get the value that are used for the database.
Parameters: nothing
Return:
\TValue|null
valueOrFallback(\TValueFallback $fallback): TValue|\TValueFallback
Parameters:
\TValueFallback $fallback
Return:
\TValue|\TValueFallback
valueOrThrowException(): TValue
Parameters: nothing
Return:
\TValue
Thanks
- Thanks to GitHub (Microsoft) for hosting the code and a good infrastructure including Issues-Management, etc.
- Thanks to IntelliJ as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
- Thanks to StyleCI for the simple but powerful code style check.
- Thanks to PHPStan && Psalm for really great Static analysis tools and for discover bugs in the code!
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-09