phpextra/enum 问题修复 & 功能扩展

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

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

phpextra/enum

最新稳定版本:1.0.0

Composer 安装命令:

composer require phpextra/enum

包简介

Enum type for PHP

关键字:

README 文档

README

#Enum type

Latest Stable Version Total Downloads License Build Status Scrutinizer Code Quality Code Coverage GitTip

##Usage

###Enum (PHPExtra\Type\EnumInterface)

Create your first enum type by creating a new class:

class TheGuy extends Enum
{
    const _default = self::NICE_GUY;
    const SMART_GUY = 'Mike';
    const NICE_GUY = 'Rick';
}

Thats all.

Now you can use it:

$guy = new TheGuy();
echo $guy->getValue(); // returns Rick

$mike = new TheGuy(TheGuy::MIKE);
echo $mike->getValue(); // returns Mike

echo $guy->isEqual($mike); // returns false

If no default value will be specified, you must set it as a constructor argument. If given constructor value will be invalid, \UnexpectedValueException will be thrown.

Installation (Composer)

{
    "require": {
        "phpextra/enum":"~1.0"
    }
}

##Changelog

No releases yet

##Contributing

All code contributions must go through a pull request. Fork the project, create a feature branch, and send me a pull request. To ensure a consistent code base, you should make sure the code follows the coding standards. If you would like to help take a look at the list of issues.

##Requirements

See composer.json for a full list of dependencies.

##Authors

Jacek Kobus - <kobus.jacek@gmail.com>

License information

See the file LICENSE.txt for copying permission.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-08-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固