承接 rickselby/consthelpers 相关项目开发

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

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

rickselby/consthelpers

最新稳定版本:1.2

Composer 安装命令:

composer require rickselby/consthelpers

包简介

关键字:

README 文档

README

Build Status Coverage Status

Helper traits to use when using a class with many constants.

Also a place for me to test CI stuff.

Example

class DataRef
{
    use \ConstHelpers\Validating;

    const POINT_NORTH = 0;
    const POINT_SOUTH = 1;
    const POINT_EAST = 2;
    const POINT_WEST = 3;
    const POINT_UP = 4;
    const POINT_DOWN = 5;

    const ORIENT_NORMAL = 6;
    const ORIENT_INVERSE = 7;
}

// Get the list of constants that start with 'POINT_'
$consts = DataRef::startsWith('POINT_'));

// Validate a value against the constants starting with 'POINT_'
if (DataRef::isValidStartsWith($value, 'POINT_')) {
...

// Validate against constants matching a regular expression
if (DataRef::isValid($value, '/T.*E/')) {
...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-17