bogosoft/collections

Contracts and implementations for working with sequences and collections.

2.1.0 2020-06-29 18:00 UTC

This package is auto-updated.

Last update: 2024-12-29 06:20:57 UTC


README

This library contains the Sequence class for fluently working with and modifying sequences of items.

The Sequence class implements the following interfaces:

  • Countable
  • IteratorAggregate

Requirements

  • PHP >= 7.4

Installation

composer require bogosoft/collections

Utility Functions

The following functions all return an instance of the Sequence class or provide Sequence-like logic in a functional manner.

Sequence Methods

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