PHPackages                             bogosoft/collections - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bogosoft/collections

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bogosoft/collections
====================

Contracts and implementations for working with sequences and collections.

2.1.0(6y ago)025[1 PRs](https://github.com/bogosoft-php/collections/pulls)MITPHPPHP &gt;=7.4CI failing

Since Dec 14Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/bogosoft-php/collections)[ Packagist](https://packagist.org/packages/bogosoft/collections)[ RSS](/packages/bogosoft-collections/feed)WikiDiscussions develop Synced today

READMEChangelogDependencies (2)Versions (7)Used By (0)

bogosoft/collections
====================

[](#bogosoftcollections)

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

[](#requirements)

- PHP &gt;= 7.4

### Installation

[](#installation)

```
composer require bogosoft/collections
```

#### Utility Functions

[](#utility-functions)

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

FunctionDescription`all(iterable, callable)`Determine if all of the items in a given sequence match a given condition.`any(iterable, ?callable)`Determine if any item in the given sequence matches a given condition.`filter(iterable, callable)`Filter an array or `Traversable` and return a new `Sequence``seq(iterable)`Creates a sequence from an iterable source (i.e., an `array` or anything that implements `Traversable`).`seqi(mixed, callable)`Create a sequence from a singleton seed value and an expansion function.`seqv(mixed ... $items)`Creates a sequence from zero or more variadic arguments.`sort(iterable, ?callable)`Sort a sequence with an optional comparer.`sortc(iterable, bool)`Sort a sequence of `IComparable` objects in either ascending or descending order.#### `Sequence` Methods

[](#sequence-methods)

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

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance49

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~49 days

Total

5

Last Release

2194d ago

Major Versions

1.2.0 → 2.0.02020-06-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/8530564fb9452a6b97b54c5cfd4da24f7f69667c217b8e37f99a593966029cdd?d=identicon)[bogocles](/maintainers/bogocles)

---

Top Contributors

[![bogocles](https://avatars.githubusercontent.com/u/8812030?v=4)](https://github.com/bogocles "bogocles (6 commits)")

---

Tags

fluentcollectionssequencesequences

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bogosoft-collections/health.svg)

```
[![Health](https://phpackages.com/badges/bogosoft-collections/health.svg)](https://phpackages.com/packages/bogosoft-collections)
```

###  Alternatives

[doctrine/collections

PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.

6.0k430.2M1.4k](/packages/doctrine-collections)[phpcollection/phpcollection

General-Purpose Collection Library for PHP

1.0k64.7M34](/packages/phpcollection-phpcollection)[dusank/knapsack

Collection library for PHP

5391.0M25](/packages/dusank-knapsack)[league/period

Time range API for PHP

7335.8M24](/packages/league-period)[samrap/acf-fluent

A fluent interface for the Advanced Custom Fields WordPress plugin

28357.5k4](/packages/samrap-acf-fluent)[hi-folks/rando-php

Random generator Library for PHP

12892.5k2](/packages/hi-folks-rando-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
