定制 zebba/utility 二次开发

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

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

zebba/utility

最新稳定版本:1.0

Composer 安装命令:

composer require zebba/utility

包简介

Zebba Utility Component

README 文档

README

Installation

Modify your composer.json:

{
    "require" : {
        "zebba/utility" : "1.*"
    }
}    

Usage

ClassUtility

<?php

$method = ClassUtility::generateMethodName(ClassUtility::ACCESS_GET, 'foo'); // getFoo
$method = ClassUtility::generateMethodName(ClassUtility::ACCESS_SET, 'foo'); // SetFoo

$method = ClassUtility::generateMethodName(ClassUtility::ACCESS_GET, 'foo_bar'); // getFooBar
$method = ClassUtility::generateMethodName(ClassUtility::ACCESS_GET, 'foo bar'); // getFooBar
$method = ClassUtility::generateMethodName(ClassUtility::ACCESS_GET, 'fooBar'); // getFooBar

ParameterConverter

<?php

$now = new \DateTime('now');
$period = new \DateInterval('P1D');

try {
    $datetimes = ParameterConverter::toArray($now, '\DateTime'); // array($now)
    
    #$datetimes = ParameterConverter::toArray(array($now, $now, $now), '\DateTime'); // array($now, $now, $now)
    #$datetimes = ParameterConverter::toArray(array($now, $interval), '\DateTime'); // \DomainException
} catch (\DomainException $e) {
    throw $e;
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-22