bonu/iterable
最新稳定版本:v1.3.2
Composer 安装命令:
composer require bonu/iterable
包简介
Handy utilities for iterables
README 文档
README
Handy utility methods that simplify iterable operations.
Requirements
- Minimum version of PHP 8.2
Installation
composer require bonu/iterable
Usage
use Bonu\Iterable\Iterables; // ['FOO', 'BAR'] Iterables::map( ['foo', 'bar'], static fn (string $value): string => mb_strtoupper($value), ); // ['FOO' => 'foo', 'BAR' => 'bar'] Iterables::mapWithKeys( ['foo', 'bar'], static fn (string $value): array => [ mb_strtoupper($value) => $value, ], ); // 'foo' Iterables::first(['foo', 'bar']); // false Iterables::isEmpty(['foo', 'bar']); // true Iterables::isNotEmpty(['foo', 'bar']); // ['foo', 'bar'] Iterables::keys(['foo' => 'bar', 'bar' => 'baz']); // [[1, 2], [3]] Iterables::chunk([1, 2, 3], 2);
License
This package is licensed under the MIT License.
统计信息
- 总下载量: 264
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-23