jeckel-lab/identity-contract 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jeckel-lab/identity-contract

Composer 安装命令:

composer require jeckel-lab/identity-contract

包简介

Contract and abstract classes to manage identities in Domains

README 文档

README

Latest Stable Version Total Downloads Build Status codecov Mutation testing badge

Identity-contract

PHP Version Package version
PHP >= 8.2 v2.0
PHP >= 8.0 v1.1

This package propose abstract classes to manage Identities in DDD projects.

Features

Builtin typed identities :

  • integer based identities
  • string based identities
  • uuid based identities

Also:

  • instance are readonly
  • equality test
  • request same identity twice return same object

Usage

Int Identity

final readonly class CarId extends AbstractIntIdentity {}

$id = CarId::from(25);

UUID Identity

use JeckelLab\IdentityContract\AbstractUuidIdentity;

final readonly class UserId extends AbstractUuidIdentity {}

$id = UserId::from("d2fbc6c0-0497-42f1-8ece-8840641b67f0");

// or

$id = UserId::new();

// Generating twice same identity return same object

$id1 = UserId::from("d2fbc6c0-0497-42f1-8ece-8840641b67f0");
$id2 = UserId::from("d2fbc6c0-0497-42f1-8ece-8840641b67f0");

var_dump($id1 === $id2); // true

统计信息

  • 总下载量: 388
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固