PHPackages                             n1215/http-request-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. [HTTP &amp; Networking](/categories/http)
4. /
5. n1215/http-request-matcher

ActiveLibrary[HTTP &amp; Networking](/categories/http)

n1215/http-request-matcher
==========================

Matcher interface for PSR-7 HTTP request, like preg\_match() for string.

v1.0.0(8y ago)21871MITPHPPHP &gt;=7.1.0CI failing

Since Dec 2Pushed 6y agoCompare

[ Source](https://github.com/n1215/http-request-matcher)[ Packagist](https://packagist.org/packages/n1215/http-request-matcher)[ Docs](https://github.com/n1215/http-request-matcher)[ RSS](/packages/n1215-http-request-matcher/feed)WikiDiscussions master Synced 1mo ago

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

http-request-matcher
====================

[](#http-request-matcher)

[![Latest Stable Version](https://camo.githubusercontent.com/258bf37377dcc1c83f19fd068e0efd0c916ec2a399ca5488b12fbf4f758f1bb1/68747470733a2f2f706f7365722e707567782e6f72672f6e313231352f687474702d726571756573742d6d6174636865722f762f737461626c65)](https://packagist.org/packages/n1215/http-request-matcher)[![License](https://camo.githubusercontent.com/b2797c90c86a16e4bdeb02d9fa9b6d6426601f2e5e87842eece873a0669c646c/68747470733a2f2f706f7365722e707567782e6f72672f6e313231352f687474702d726571756573742d6d6174636865722f6c6963656e7365)](https://packagist.org/packages/n1215/http-request-matcher)[![Build Status](https://camo.githubusercontent.com/05f69bd0ad68bfdf6584cc66f0806efc01e1da31b1a98242574dbaafad1e30de/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e313231352f687474702d726571756573742d6d6174636865722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/n1215/http-request-matcher/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/61557375a1c2170615cb7dabdddbbd114601399d45094a246e077df648e501e6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e313231352f687474702d726571756573742d6d6174636865722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/n1215/http-request-matcher/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6f7fc048205a9f4d021aae33ccef105de101891199330a072ea661d5eb4a59be/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e313231352f687474702d726571756573742d6d6174636865722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/n1215/http-request-matcher/?branch=master)

Matcher interface for PSR-7 HTTP request, like preg\_match() for string.

Usage
-----

[](#usage)

```
// 1. implement RequestMatcherInterface or ServerRequestMatcherInterface. you can use RequestMatchResult concrete class.

class YourServerRequestMatcher implements ServerRequestMatcherInterface
{
    public function match(ServerRequestInterface $request): RequestMatchResultInterface
    {
        // implement
    }
}

// 2. use for PSR-7 Request
$matcher = new YourServerRequestMatcher();

/** @var \Psr\Http\Message\ServerRequestInterface $request */
$result = $matcher->match($request);

if ($result->isSuccess()) {
    var_dump($result->getParams());
}
```

Implementation examples
-----------------------

[](#implementation-examples)

- see [test](tests/RequestMatcherTest.php)
- [n1215/hakudo : MethodAndPathMatcher](https://github.com/n1215/hakudo/blob/v0.3.0/src/RequestMatcher/MethodAndPathMatcher.php)

Class diagram
-------------

[](#class-diagram)

[![request-matcher](doc/request-matcher.png)](doc/request-matcher.png)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% 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 ~3 days

Total

3

Last Release

3074d ago

Major Versions

v0.2.0 → v1.0.02017-12-08

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2157593?v=4)[n1215](/maintainers/n1215)[@n1215](https://github.com/n1215)

---

Top Contributors

[![n1215](https://avatars.githubusercontent.com/u/2157593?v=4)](https://github.com/n1215 "n1215 (10 commits)")[![nakae-nextat](https://avatars.githubusercontent.com/u/14865989?v=4)](https://github.com/nakae-nextat "nakae-nextat (1 commits)")

---

Tags

http-requestmatcherphppsr-7webpsr-7http requestmatcher

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/n1215-http-request-matcher/health.svg)

```
[![Health](https://phpackages.com/badges/n1215-http-request-matcher/health.svg)](https://phpackages.com/packages/n1215-http-request-matcher)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.0B3.1k](/packages/guzzlehttp-psr7)[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

538204.9M23](/packages/league-uri-interfaces)[laminas/laminas-psr7bridge

Bidirectional conversions between PSR-7 and laminas-http messages

117.9M18](/packages/laminas-laminas-psr7bridge)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28483.0k2](/packages/mezzio-mezzio-authentication-oauth2)[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

121.6M26](/packages/mezzio-mezzio-authentication)

PHPackages © 2026

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