PHPackages                             ascii-soup/hamcrest-callback-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ascii-soup/hamcrest-callback-matcher

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

ascii-soup/hamcrest-callback-matcher
====================================

Hamcrest matcher that matches against a provided callback.

1.1(10y ago)17.0k1MITPHP

Since Mar 16Pushed 10y ago1 watchersCompare

[ Source](https://github.com/ascii-soup/hamcrest-callback-matcher)[ Packagist](https://packagist.org/packages/ascii-soup/hamcrest-callback-matcher)[ RSS](/packages/ascii-soup-hamcrest-callback-matcher/feed)WikiDiscussions master Synced 2d ago

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

Hamcrest Callback Matcher
=========================

[](#hamcrest-callback-matcher)

Usage:

```
assertThat("hello", matchesUsing(function($value) { return $value === "hello"; }));
```

Creating new custom matchers
----------------------------

[](#creating-new-custom-matchers)

Creating new custom matchers is made simpler with the callback matcher.

You can use `describedAs()` to provide a better description for the expectation.

```
function myCustomMatcher()
{
    return describedAs('a custom value', new CallbackMatcher(
        function($value) {
            return $value === 'my custom value';
        }
    )
}
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

3762d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/627657?v=4)[ASCII Soup](/maintainers/ascii-soup)[@ascii-soup](https://github.com/ascii-soup)

---

Top Contributors

[![ascii-soup](https://avatars.githubusercontent.com/u/627657?v=4)](https://github.com/ascii-soup "ascii-soup (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ascii-soup-hamcrest-callback-matcher/health.svg)

```
[![Health](https://phpackages.com/badges/ascii-soup-hamcrest-callback-matcher/health.svg)](https://phpackages.com/packages/ascii-soup-hamcrest-callback-matcher)
```

###  Alternatives

[ramsey/devtools-lib

The library behind ramsey/devtools, allowing for extension of the ramsey/devtools Composer plugin.

2335.1k2](/packages/ramsey-devtools-lib)[aginev/datagrid

Datagrid Package for Laravel v5+

4729.9k](/packages/aginev-datagrid)[dholmes/bga-workbench

BoardGameArena Workbench

385.3k](/packages/dholmes-bga-workbench)[birgir/combined-query

Modify the WP\_Query to support the combined\_query parameter. Combine multiple WP\_Query queries into a single query.

711.3k](/packages/birgir-combined-query)

PHPackages © 2026

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