承接 bonu/iterable 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

bonu/iterable

最新稳定版本:v1.3.2

Composer 安装命令:

composer require bonu/iterable

包简介

Handy utilities for iterables

README 文档

README

PHPUnit

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-23