承接 jgimeno/value-objects 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

jgimeno/value-objects

Composer 安装命令:

composer require jgimeno/value-objects

包简介

Collection of PHP value objects to use and extend as building blocks for DDD.

README 文档

README

Build Status Coverage Status Code Climate

Ultimate PHP Value Object Collection

Collection of PHP value objects to use and extend as building blocks for DDD.

This library comes with the idea of having a starting point for defining value objects for different projects.

All the value objects are inmutable.

How to install

You can get it using composer:

composer require jgimeno/value-objects

How to use

Base objects

The idea of this library is to have a collection of objects as a base for the creation of your Domain.

The most basic object is the ValueObject which we can extend all the value objects we want to create from. Base ValueObject implements __toString() and equals() methods (i.e. you get them for free).

If we know that our value objects will benefit from the methods included in the objects Strings, Number or Boolean, we can extend from there.

Rationale

Imagine that I create an object called SonName that our domain needs. In that case it could be useful to extend from Strings and we will have methods like toUpperCase(), trim(), etc that we can reuse. You get the idea.

Lastly there is another base object called Identifier. This is useful when creating ids, for example, a UserId can extend from Identifier. Then we can do UserId::generate() and we will have a unique userId generated using UUIDs.

Useful objects

Internet\Email: Object representing an email address, it throws exceptions when given email is not a valid email.

Internet\IpAddress: Object that represents an IP address, it throws exception when is not a valid ip address.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固