bbrothers/enum
Composer 安装命令:
composer require bbrothers/enum
包简介
A simple PHP Enum implementation
关键字:
README 文档
README
A very simple PHP Enum implementation.
Install
Via Composer
$ composer require bbrothers/enum
Usage
class Weekdays extends Enum { const MONDAY = 'monday'; const TUESDAY = 'tuesday'; const WEDNESDAY = 'wednesday'; const THURSDAY = 'thursday'; const FRIDAY = 'friday'; } // ... $day = Weekdays::TUESDAY(); $day->equals(Weekdays::MONDAY()); // false $day->isSelected(Weekdays::TUESDAY); // true (string) $day; // tuesday Weekdays::values(); // monday, tuesday, wednesday, thursday, friday Weekdays::keys(); // MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 162
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-03-02