定制 mhndev/value-objects 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

mhndev/value-objects

Composer 安装命令:

composer require mhndev/value-objects

包简介

common value Objects

README 文档

README

Common mostly used Value Objects I confronted through my own Projects
sample codes
use mhndev\valueObjects\implementations\Email;
use mhndev\valueObjects\implementations\MobilePhone;
use mhndev\valueObjects\implementations\Token;
use mhndev\valueObjects\implementations\Version;

$mobileObject = MobilePhone::fromOptions('989124444444');

echo $mobileObject->format(MobilePhone::WithZero);

### output : 09124444444

echo $mobileObject->format(MobilePhone::WithoutZero);

### output : 9124444444

echo $mobileObject->isMCI(MobilePhone::WithoutZero);

### output : true

echo $mobileObject->isMTN(MobilePhone::WithoutZero);

### output : false

$emailObject = new Email('info@example.com');

echo $emailObject->getDomain();

### output : example.com

echo $emailObject->getLocal();

### output : info


$tokenObject = new Token(
    'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImVhMTY3OTQ',
    Token::SCHEMA_Bearer,
    6000
);

echo $tokenObject->getType();

### output : Bearer

echo $tokenObject->getExpiresAt()->format('Y-m-d H:i:s');

### output : 2018-12-03 08:05:22


$port = Version::fromString('6.5.0');


echo $port->getMajor();
### output : 6


echo $port->getMinor();
### output : 0


echo $port->getPatch();
### output : 5

you can find more examples by digging in source.

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固