bogosoft/collections

处理序列和集合的合约和实现。

2.1.0 2020-06-29 18:00 UTC

This package is auto-updated.

Last update: 2024-09-29 05:28:57 UTC


README

此库包含用于流畅地处理和修改项目序列的 Sequence 类。

Sequence 类实现了以下接口

  • Countable
  • IteratorAggregate

需求

  • PHP >= 7.4

安装

composer require bogosoft/collections

实用函数

以下所有函数都返回 Sequence 类的实例或在函数式方式中提供类似 Sequence 的逻辑。

Sequence 方法

  • all
  • any
  • append
  • apply
  • collect
  • count
  • filter
  • fold
  • getFirst
  • getFirstOrDefault
  • getLast
  • getLastOrDefault
  • getSingle
  • getSingleOrDefault
  • iter
  • map
  • prepend
  • skip
  • sort
  • sortc
  • take
  • toArray