alcamo/range
最新稳定版本:0.1.1
Composer 安装命令:
composer require alcamo/range
包简介
Ranges of various types
关键字:
README 文档
README
use alcamo\range\NonNegativeRange;
$range = NonNegativeRange::newFromString('3-7');
foreach ([-1, 0, 2, 3, 5, 7, 8] as $value) {
echo "contains $value: " . $range->contains($value) . "\n";
}
This will output:
contains -1: 0
contains 0: 0
contains 2: 0
contains 3: 1
contains 5: 1
contains 7: 1
contains 8: 0
Provided interfaces, traits and classes
- The interface
RangeInterfaceprovides a very basic interface for ranges of any kind. - The trait
RangeTraitprovides a simple implementation which covers most of what is needed forRangeInterface. - The class
NonNegativeRangeprovides an implementation of a range of nonnegative integers, potentially unbounded from above, including the bound(s).
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2025-10-22