PHPackages                             kahlan/extra-matcher - 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. kahlan/extra-matcher

ActiveLibrary

kahlan/extra-matcher
====================

Additional matchers for Kahlan.

1.0.0(9y ago)61.5k25MITPHPPHP &gt;=5.4

Since Apr 7Pushed 7y ago6 watchersCompare

[ Source](https://github.com/kahlan/extra-matcher)[ Packagist](https://packagist.org/packages/kahlan/extra-matcher)[ RSS](/packages/kahlan-extra-matcher/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (5)

Kahlan Additional Matchers
==========================

[](#kahlan-additional-matchers)

[![Build Status](https://camo.githubusercontent.com/4d7994a6d0c3b4e64eab874ecf2adfb8859d730de7912cdabc245e651ed53800/68747470733a2f2f7472617669732d63692e6f72672f6b61686c616e2f65787472612d6d6174636865722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/kahlan/extra-matcher)[![Code Coverage](https://camo.githubusercontent.com/4c9123d29c450c56ab449e7d57b214fb656363bdc3d2209d3e4a59030cc52fa9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b61686c616e2f65787472612d6d6174636865722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kahlan/extra-matcher/?branch=master)

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

[](#installation)

### via Composer

[](#via-composer)

```
$ composer require --dev kahlan/extra-matcher
```

Registration
------------

[](#registration)

To manually register the matchers you want, add them in your `kahlan-config.php` config file like in the following example:

```
use Kahlan\Extra\Matcher\ExtraMatchers;

ExtraMatchers::register(['toBeOneOf', ...]);
```

Or in case you want to register all matchers, you can simply write:

```
use Kahlan\Extra\Matcher\ExtraMatchers;

ExtraMatchers::register();
```

Documentation
-------------

[](#documentation)

**toBeOneOf($expected)** // strict comparison

```
it("passes if $actual is present in $expected", function() {
    expect(3)->toBeOneOf([1, 2, 3]);
});
```

**toEqualOneOf($expected)** // loose comparison

```
it("passes if $actual is present in $expected", function() {
    expect("3")->toEqualOneOf([1, 2, 3]);
});
```

**toImplement($expected)** // object implements expected interface

```
namespace App\Spec;

it("passes if $actual implements $expected", function() {

    interface Foo { }
    class Bar implements Foo {}

    $actual = new Bar();
    expect($actual)->toImplement('App\Spec\Foo');
});
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

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

3320d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67c78f317fdfb9f077b1f16c88193192f7562e999c536b25943b759c3b5099fb?d=identicon)[jails](/maintainers/jails)

---

Top Contributors

[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (44 commits)")[![jails](https://avatars.githubusercontent.com/u/1306941?v=4)](https://github.com/jails "jails (8 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/kahlan-extra-matcher/health.svg)

```
[![Health](https://phpackages.com/badges/kahlan-extra-matcher/health.svg)](https://phpackages.com/packages/kahlan-extra-matcher)
```

PHPackages © 2026

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