PHPackages                             alexeyshockov/colada-x - 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. alexeyshockov/colada-x

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

alexeyshockov/colada-x
======================

Helper function for simplification callbacks

v0.3.0(7y ago)139112MITPHPPHP ~5.6 || ~7.0

Since Jun 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/alexeyshockov/colada-x)[ Packagist](https://packagist.org/packages/alexeyshockov/colada-x)[ Docs](http://github.com/alexeyshockov/colada-x)[ RSS](/packages/alexeyshockov-colada-x/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (2)

\\Colada\\x()
=============

[](#coladax)

Helper function for simplify callbacks.

[![Latest Stable Version](https://camo.githubusercontent.com/cf25d24e2e20a905411f9b7e19503d9a23252618c64189bda8cf052398a3ea17/68747470733a2f2f706f7365722e707567782e6f72672f616c6578657973686f636b6f762f636f6c6164612d782f762f737461626c65)](https://packagist.org/packages/alexeyshockov/colada-x)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/1ba1361f904cea7a8a4461ea5b70fd2b63043eb5bd6c882ed843fe3a83b535da/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c6578657973686f636b6f762f636f6c6164612d782f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/alexeyshockov/colada-x/?branch=master)[![Build Status](https://camo.githubusercontent.com/5e5681f7761e5de9681ea636b1a46f2596dbcf972975acee1747ce92c0a5f91b/68747470733a2f2f6170692e7472617669732d63692e6f72672f616c6578657973686f636b6f762f636f6c6164612d782e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/alexeyshockov/colada-x)

Installation
------------

[](#installation)

```
$ composer require alexeyshockov/colada-x
```

Usage
-----

[](#usage)

With ColadaX:

```
$activeUsers = array_filter($users, \Colada\x()->isActive());
```

```
$role = 'ADMIN';
$administrators = array_filter($users, \Colada\x()->hasRole($role));
```

Instead of pure PHP:

```
$activeUsers = array_filter($users, function ($user) {
    return $user->isActive();
});
```

```
$role = 'ADMIN';
$activeUsers = array_filter($users, function ($user) use ($role) {
    return $user->hasRole($role);
});
```

Useful together
---------------

[](#useful-together)

Some code examples for your imagination.

### Laravel 5 Collections

[](#laravel-5-collections)

```
$activeUsers = $users->filter(\Colada\x()->isActive());
```

### PHP Collection ([schmittjoh/php-collection](https://github.com/schmittjoh/php-collection/))

[](#php-collection-schmittjohphp-collection)

```
$activeUsers = $users->filter(\Colada\x()->isActive());
```

### functional-php ([lstrojny/functional-php](https://github.com/lstrojny/functional-php))

[](#functional-php-lstrojnyfunctional-php)

The library already has `partial_method` function, but it's less powerful.

```
use Functional as F;

$activeUsers = F\select($users, \Colada\x()->isActive());
```

Less useful, but still
----------------------

[](#less-useful-but-still)

### Doctrine 2 Collections (Symfony 2, Doctine 2 ORM, etc.)

[](#doctrine-2-collections-symfony-2-doctine-2-orm-etc)

```
// __asClosure() is needed because all Doctrine's methods accept only \Closure instances :(
$hasActiveUsers = $users->exists(\Colada\x()->isActive()->__asClosure());
```

### Laravel 4 Collections

[](#laravel-4-collections)

The same problem as described above with Doctrine.

Alernatives
-----------

[](#alernatives)

If you need only the basic functionaly, take a look at `invoke()`, `invoke_first()`, `invoke_if()`, `invoke_last()`, `invoker()` from a great [functional-php library](https://github.com/lstrojny/functional-php).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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 ~673 days

Total

3

Last Release

2649d ago

PHP version history (2 changes)v0.1.0PHP &gt;=5.3.2

v0.2.0PHP ~5.6 || ~7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/dbb1137342b76983ce06549ef8a9eb3332c3f35c30a45298c9070bc93b26db95?d=identicon)[alexeyshockov](/maintainers/alexeyshockov)

---

Top Contributors

[![alexeyshockov](https://avatars.githubusercontent.com/u/203120?v=4)](https://github.com/alexeyshockov "alexeyshockov (18 commits)")

---

Tags

collectionsfunctional

### Embed Badge

![Health badge](/badges/alexeyshockov-colada-x/health.svg)

```
[![Health](https://phpackages.com/badges/alexeyshockov-colada-x/health.svg)](https://phpackages.com/packages/alexeyshockov-colada-x)
```

###  Alternatives

[doctrine/collections

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

6.0k411.1M1.2k](/packages/doctrine-collections)[lstrojny/functional-php

Functional primitives for PHP

2.0k7.3M48](/packages/lstrojny-functional-php)[nikic/iter

Iteration primitives using generators

1.1k5.9M38](/packages/nikic-iter)[qaribou/immutable.php

Immutable, highly-performant collections, well-suited for functional programming and memory-intensive applications.

344146.0k](/packages/qaribou-immutablephp)[dusank/knapsack

Collection library for PHP

5351.0M25](/packages/dusank-knapsack)[lambdish/phunctional

λ PHP functional library

3612.0M23](/packages/lambdish-phunctional)

PHPackages © 2026

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