PHPackages                             yosugi/functional-tools.php - 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. yosugi/functional-tools.php

ActiveLibrary

yosugi/functional-tools.php
===========================

Simple functional tools for PHP

0.2.0(5y ago)317[1 PRs](https://github.com/yosugi/functional-tools.php/pulls)MITPHPPHP ^7.4CI failing

Since May 21Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/yosugi/functional-tools.php)[ Packagist](https://packagist.org/packages/yosugi/functional-tools.php)[ Docs](https://github.com/yosugi/functional-tools.php)[ RSS](/packages/yosugi-functional-toolsphp/feed)WikiDiscussions master Synced 1w ago

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

functional-tools.php
====================

[](#functional-toolsphp)

Simple functional tools in PHP

Usage
-----

[](#usage)

see tests/

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

[](#installation)

```
$ composer require yosugi/functional-tools.php

```

Methods
-------

[](#methods)

### Arrays

[](#arrays)

- get(string $key, ?array $argInputArray = null) //: callable|mixed
- set(string $key, $value, ?array $argInputArray = null) //: callable|array
- flatten(?array $argInputs = null) //: callable|array
- toPairs(?array $argInputs = null) //: callable|array
- fromPairs(?array $argInputs = null) //: callable|array
- keys(?array $argInputs = null) //: callable|array
- values(?array $argInputs = null) //: callable|array
- filter(callable $predicate, ?array $argInputs = null) //: callable|array
- map(callable $fn, ?array $argInputs = null) //: callable|array
- reduce(callable $fn, $initial, ?array $argInputs = null) //: callable|mixed
- head(?array $argInputs = null) //: callable|array
- rest(?array $argInputs = null) //: callable|array
- sortBy(callable $fn, ?array $argInputs = null) //: callable|array

### Collections

[](#collections)

- filter(callable $predicate, ?iterable $argInputs = null) //: callable|array
- map(callable $fn, ?iterable $argInputs = null) //: callable|array
- reduce(callable $fn, $initial, ?iterable $argInputs = null) //: callable|mixed
- head(?iterable $argInputs = null) //: callable|array
- rest(?iterable $argInputs = null) //: callable|array
- sortBy(callable $fn, ?iterable $argInputs = null) //: callable|array

### Functions

[](#functions)

- compose(callable ...$fns): callable
- pipe(callable ...$fns): callable
- partial(callable $fn, ...$args): callable
- curry(callable $fn, ...$args): callable
- tap(...$argInputs) //: mixed

### Strings

[](#strings)

- split(string $delimiter, ?string $argInput = null) //: callable|string
- join(string $glue, ?array $argInputs = null) //: callable|string
- replace($search, $replace, ?string $argInput = null) //: callable|string
- pregReplace($pattern, $replacement, ?string $argInput = null) //: callable|string
- trim(?string $argInput = null) //: callable|string

License
-------

[](#license)

[MIT License](LICENSE)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance53

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Total

2

Last Release

2188d ago

### Community

Maintainers

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

---

Top Contributors

[![yosugi](https://avatars.githubusercontent.com/u/2996425?v=4)](https://github.com/yosugi "yosugi (26 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yosugi-functional-toolsphp/health.svg)

```
[![Health](https://phpackages.com/badges/yosugi-functional-toolsphp/health.svg)](https://phpackages.com/packages/yosugi-functional-toolsphp)
```

PHPackages © 2026

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