PHPackages                             crocodile2u/chainy - 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. crocodile2u/chainy

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

crocodile2u/chainy
==================

v1.0(7y ago)29113PHPPHP &gt;=7.0

Since Dec 9Pushed 7y ago1 watchersCompare

[ Source](https://github.com/crocodile2u/chainy)[ Packagist](https://packagist.org/packages/crocodile2u/chainy)[ RSS](/packages/crocodile2u-chainy/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

Chainy - a nicer way to apply a set of functions to a value
===========================================================

[](#chainy---a-nicer-way-to-apply-a-set-of-functions-to-a-value)

Have you ever written code like this?

```
$array = array_filter($array);
$array = array_map(
    $array,
    function($element) {
        // ... manipulations ...
        return $modifiedElement;
    }
);
sort($array);
```

Know what? You could do the same in a more readable and nice way:

```
$chain = (new \chainy\Chain)

    ->filter()

    ->map(
        function($element) {
            // ... manipulations ...
            return $modifiedElement;
        }
    )

    ->sort();

$array = $chain->apply($array);
```

Chainy is a pipeline of functions, where every next one gets input from the previous one's output. In the example above, when *$chain-&gt;apply()* is called on *$array*, it goes sequentially through *filter()*, *map()* and *sort()*. As you can expect, those methods are just wrappers for the PHP's built-in functions *array\_filter*, *array\_map* and *sort*.

This is how things go with chainy:

1. Create new Chain instance.
2. Setup the pipeline, adding elements to the chain (in this casem *filter* to get rid of empty element, *map* to apply some modifications to every element that survived filter, and then sort the resulting array).
3. Call Chain-&gt;apply() on the input array. The result is the filtered, modified and sorted array.

```
$chain = (new \chainy\Chain)

+------> filter() --+
|                   |
|    +--------------+
|    |
|    +-> map(function()...) --+
|                             |
|    +------------------------+
|    |
|    +-> sort();
|
| $array = $chain->apply($array);
|                          |
|--------------------------+
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61.1% 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

Unknown

Total

1

Last Release

2712d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/842b8cd849df1fb1ce8258823b21ce1816ca52f026a68da26562d9d83854ca19?d=identicon)[crocodile2u](/maintainers/crocodile2u)

---

Top Contributors

[![crocodile2u](https://avatars.githubusercontent.com/u/1736820?v=4)](https://github.com/crocodile2u "crocodile2u (11 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (4 commits)")[![benyazi](https://avatars.githubusercontent.com/u/9716505?v=4)](https://github.com/benyazi "benyazi (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/crocodile2u-chainy/health.svg)

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

###  Alternatives

[myxtype/eos-client

php eos client offline sign eosphp-ecc

462.1k](/packages/myxtype-eos-client)[helori/laravel-seo

SEO tools to insert meta and structured-data in laravel projects

134.9k](/packages/helori-laravel-seo)

PHPackages © 2026

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