star / identity
封装身份概念的类库。
2.0.0
2022-10-16 15:30 UTC
Requires
- php: ^7.4|^8.0
Requires (Dev)
- infection/infection: ^0.26.15
- phpstan/phpstan: ^1.8
- phpstan/phpstan-phpunit: ^1.1
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.7
This package is auto-updated.
Last update: 2024-09-16 19:41:58 UTC
README
描述
此包定义了一个接口 Star\Component\Identity\Identity
,用于标记你的对象为实体。
它还包括一些默认实现。
用法
安装
使用 composer 运行 composer require star/identity
。
身份
$integer = new IntegerId(4); $string = new StringId('something'); $composite = new CompositeIdentity($integer, $string); $integer->toString(); // return '4' $string->toString(); // return 'something' $composite->toString(); // return '4 something'
异常
我们还提供了带有身份消息的异常。