定制 alcamo/range 二次开发

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

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

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 RangeInterface provides a very basic interface for ranges of any kind.
  • The trait RangeTrait provides a simple implementation which covers most of what is needed for RangeInterface.
  • The class NonNegativeRange provides an implementation of a range of nonnegative integers, potentially unbounded from above, including the bound(s).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2025-10-22