PHPackages                             vnn/keyper - 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. vnn/keyper

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

vnn/keyper
==========

Do things based on the presence of a key

1.3.1(10y ago)678.8k↓48.3%1MITPHPPHP &gt;=5.4

Since May 2Pushed 10y ago9 watchersCompare

[ Source](https://github.com/varsitynewsnetwork/keyper)[ Packagist](https://packagist.org/packages/vnn/keyper)[ RSS](/packages/vnn-keyper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (11)Used By (0)

Keyper
======

[](#keyper)

[![Build Status](https://camo.githubusercontent.com/1564e1c2b2c2d2524c252271eb123099b348c315a18e020aa0dcb7ab17f10dea/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f766172736974796e6577736e6574776f726b2f6b65797065722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/varsitynewsnetwork/keyper)

> Do things when an array has a key

Usage
-----

[](#usage)

```
$data = [
    'key1' => 'hello',
    'nested' => [
        'one' => 1,
        'two' => 2,
        'three' => [
            'four' => 5
        ]
    ]
];

$keyper = Keyper::create($data);

//do something with a single value
$keyper->when('key1', function($value) {
    //$value == 'hello'
    print $value;
});

//drill down a nested array
$keyper->when('nested.three.four', function($value) {
    //$value == 5
    print $value;
});

//do something with multiple keys
$keyper->when(['nested.one', 'nested.two'], function($one, $two) {
    //$one == 1
    //$two == 2
    print $one + $two;
});

//compose several functions
$keyper->when(['nested.one', 'nested.two'], function($sum) {
    //$sum == 3
    print $sum;
}, function($one, $two) {
    //$one == 1
    //$two == 2
    return $one + $two; //this result gets passed to the function using $sum
});

//if you need all the specified keys to be present, use whenAll
$keyper->whenAll(['nested.one', 'nested.two'], function($one, $two) {
    //$one == 1
    //$two == 2
    print $one + $two;
});
```

Running tests
-------------

[](#running-tests)

```
composer install

vendor/bin/phpunit

```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 65.2% 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 ~56 days

Recently: every ~111 days

Total

10

Last Release

3889d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/56d64bb281704f2cafc6fc8dfeaeca65db72b8b49e0f999468503307b1235814?d=identicon)[boboudreau](/maintainers/boboudreau)

![](https://www.gravatar.com/avatar/03b024ab0f53ad6251ff0aa65e8b0e701874acea2d2e16bd8488de1015ad5df6?d=identicon)[dusty.satt](/maintainers/dusty.satt)

---

Top Contributors

[![brianium](https://avatars.githubusercontent.com/u/636651?v=4)](https://github.com/brianium "brianium (15 commits)")[![austinsmorris](https://avatars.githubusercontent.com/u/1616868?v=4)](https://github.com/austinsmorris "austinsmorris (6 commits)")[![mrkrstphr](https://avatars.githubusercontent.com/u/164472?v=4)](https://github.com/mrkrstphr "mrkrstphr (2 commits)")

---

Tags

arrayfunction

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vnn-keyper/health.svg)

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

###  Alternatives

[doctrine/collections

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

6.0k411.1M1.2k](/packages/doctrine-collections)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)[openlss/lib-array2xml

Array2XML conversion library credit to lalit.org

31052.5M47](/packages/openlss-lib-array2xml)

PHPackages © 2026

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