PHPackages                             woohoolabs/harmony - 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. [Framework](/categories/framework)
4. /
5. woohoolabs/harmony

ActiveLibrary[Framework](/categories/framework)

woohoolabs/harmony
==================

Woohoo Labs. Harmony

8.0.1(1y ago)16612.7k↑50%16[1 PRs](https://github.com/woohoolabs/harmony/pulls)2MITPHPPHP ^8.0.0CI passing

Since Oct 1Pushed 3mo ago9 watchersCompare

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

READMEChangelog (10)Dependencies (14)Versions (44)Used By (2)

Woohoo Labs. Harmony
====================

[](#woohoo-labs-harmony)

[![Latest Version on Packagist](https://camo.githubusercontent.com/eb6972377e0663d4e8308979f32b3e148f54ce5536057f22c866ac3ef98863d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776f6f686f6f6c6162732f6861726d6f6e792e737667)](https://packagist.org/packages/woohoolabs/harmony)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Build Status](https://camo.githubusercontent.com/6ae0820ed04e5bdd49794efd3a0d9bad99e22225920ed0415263821bdbe21ab6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f776f6f686f6f6c6162732f6861726d6f6e792f436f6e74696e756f7573253230496e746567726174696f6e)](https://github.com/woohoolabs/harmony/actions)[![Coverage Status](https://camo.githubusercontent.com/7e4ec41290943fc77755da24c5778e677fe367426ea0475154f781c192f2d72a/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f776f6f686f6f6c6162732f6861726d6f6e79)](https://codecov.io/gh/woohoolabs/harmony)[![Quality Score](https://camo.githubusercontent.com/5c03c43adc3516f9cf3e99c7eadaba01bb1accda5dc23c6b5647263eb63bbc89/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f776f6f686f6f6c6162732f6861726d6f6e792e737667)](https://scrutinizer-ci.com/g/woohoolabs/harmony)[![Total Downloads](https://camo.githubusercontent.com/093d1b73f9ec16a7167460f776a5f609e7dfbedf17b89ce116e998c1d49a6dc7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f776f6f686f6f6c6162732f6861726d6f6e792e737667)](https://packagist.org/packages/woohoolabs/harmony)[![Gitter](https://camo.githubusercontent.com/2b52513f6abbcd8b6169b4854ca77e909fbf3bd537a6dde787e445429f834986/68747470733a2f2f6261646765732e6769747465722e696d2f776f6f686f6f6c6162732f6861726d6f6e792e737667)](https://gitter.im/woohoolabs/harmony?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

**Woohoo Labs. Harmony is a PSR-15 compatible middleware dispatcher.**

Harmony was born to be a totally flexible and almost invisible framework for your application. That's why Harmony supports the [PSR-7](https://www.php-fig.org/psr/psr-7/), [PSR-11](https://www.php-fig.org/psr/psr-11/), as well as the [PSR-15](https://www.php-fig.org/psr/psr-15/) standards.

Table of Contents
-----------------

[](#table-of-contents)

- [Introduction](#introduction)
- [Install](#install)
- [Basic Usage](#basic-usage)
- [Advanced Usage](#advanced-usage)
- [Examples](#examples)
- [Versioning](#versioning)
- [Change Log](#change-log)
- [Testing](#testing)
- [Contributing](#contributing)
- [Support](#support)
- [Credits](#credits)
- [License](#license)

Introduction
------------

[](#introduction)

### Rationale

[](#rationale)

This blog post explains the idea best why Harmony was started back in 2014:

### Features

[](#features)

- High performance due to Harmony's simplicity
- High flexibility thanks to the vast middleware ecosystem of PSR-15
- Full control over HTTP messages via PSR-7
- Support for many DI Containers via PSR-11 (formerly known as Container-Interop)

### Why Harmony?

[](#why-harmony)

There are a lot of very similar middleware dispatcher libraries out there, like [Laminas-Stratigility](https://github.com/laminas/laminas-stratigility), [Slim Framework 3](https://www.slimframework.com/docs/concepts/middleware.html) or [Relay](http://relayphp.com/). You might ask yourself, what is the purpose of yet another library with the same functionality?

We believe Harmony offers two key features which justify its existence:

- It is the most simple library of all. Although simplicity is subjective, one thing is certain: Harmony offers the bare minimum functionality of what a library like this would need. That's why Harmony itself fits into a single class of ~140 lines.
- As of version 3, Harmony natively supports the concept of [Conditions](#defining-conditions) which is a rare feature for middleware dispatchers. This eases dealing with a major weakness of the middleware-oriented approach, namely, the ability to invoke middleware conditionally.

### Use cases

[](#use-cases)

Certainly, Harmony won't suit the needs of all projects and teams: this framework works best for an experienced team with a longer term project. Less experienced teams - especially if they have short deadlines - should probably choose a framework with more features - working out-of-the box - in order to speed up development in its initial phase. Harmony's flexibility is the most advantageous when your software should be supported for a longer time.

### Concepts

[](#concepts)

Woohoo Labs. Harmony is built upon two main concepts: middleware, which promote separation of concerns, and common interfaces, making it possible to rely on loosely coupled components.

By using middleware, you can easily take hands on the course of action of the request-response lifecycle: you can authenticate before routing, do some logging after the response has been sent, or you can even dispatch multiple routes in one request. This all can be achieved because everything in Harmony is a middleware, so the framework itself only consists of cc. 140 lines of code. This is why there is no framework-wide configuration, only middleware can be configured. What you do with Harmony depends only on your imagination and needs.

But middleware must work in cooperation (the router and the dispatcher are particularly tightly coupled to each other). That's why it is also important to provide common interfaces for the distinct components of the framework.

Naturally, we decided to use [PSR-7](https://www.php-fig.org/psr/psr-7/)for modelling the HTTP request and response. In order to facilitate the usage of different DI Containers, we adapted [PSR-11 (former Container-Interop)](https://www.php-fig.org/psr/psr-11/)which is supported by various containers out of the box.

### Middleware interface design

[](#middleware-interface-design)

Woohoo Labs. Harmony's middleware interface design is based on the the [PSR-15](https://www.php-fig.org/psr/psr-15/) de-facto standard.

If you want to learn about the specifics of this style, please refer to the following articles which describe the very concept:

- [PSR-15 Meta Document](https://www.php-fig.org/psr/psr-15/meta/)
- [PSR-15](https://mwop.net/blog/2018-01-23-psr-15.html)

Install
-------

[](#install)

The only thing you need before getting started is [Composer](https://getcomposer.org).

### Install a PSR-7 implementation:

[](#install-a-psr-7-implementation)

Because Harmony requires a PSR-7 implementation (a package which provides the `psr/http-message-implementation` virtual package), you must install one first. You may use [Laminas Diactoros](https://github.com/laminas/laminas-diactoros) or any other library of your preference:

```
$ composer require laminas/laminas-diactoros
```

### Install Harmony:

[](#install-harmony)

To install the latest version of this library, run the command below:

```
$ composer require woohoolabs/harmony
```

> Note: The tests and examples won't be downloaded by default. You have to use `composer require woohoolabs/harmony --prefer-source`or clone the repository if you need them.

Harmony 6.2+ requires PHP 7.4 at least, but you may use Harmony 6.1 for PHP 7.1+.

### Install the optional dependencies:

[](#install-the-optional-dependencies)

If you want to use the default middleware stack then you have to require the following dependencies too:

```
$ composer require nikic/fast-route # FastRouteMiddleware needs it
$ composer require laminas/laminas-httphandlerrunner # LaminasEmitterMiddleware needs it
```

Basic Usage
-----------

[](#basic-usage)

### Define your endpoints:

[](#define-your-endpoints)

The following example applies only if you use the [default dispatcher middleware](https://github.com/woohoolabs/harmony/blob/master/src/Middleware/DispatcherMiddleware.php). There are two important things to note here: first, each dispatchable endpoint receives a `Psr\Http\Message\ServerRequestInterface`and a `Psr\Http\Message\ResponseInterface` object as parameter and the latter is expected to be manipulated and returned. Secondly, you can not only use class methods as endpoints, it is possible to define other callables too (see below in the routing section).

```
namespace App\Controllers;

use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;

class UserController
{
    public function getUsers(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
    {
        $users = ["Steve", "Arnie", "Jason", "Bud"];
        $response->getBody()->write(json_encode($users));

        return $response;
    }

    public function updateUser(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
    {
        $userId = $request->getAttribute("id");
        $userData = $request->getParsedBody();

        // Updating user...

        return $response;
    }
}
```

### Define your routes:

[](#define-your-routes)

The following example applies only if you use the [default router middleware](https://github.com/woohoolabs/harmony/blob/master/src/Middleware/FastRouteMiddleware.php)which is based on [FastRoute](https://github.com/nikic/FastRoute), the library of Nikita Popov. We chose to use it by default because of its performance and simplicity. You can read more about it [in Nikita's blog](https://nikic.github.io/2014/02/18/Fast-request-routing-using-regular-expressions.html).

Let's add the routes for the aforementioned endpoints to FastRoute:

```
use App\Controllers\UserController;

$router = FastRoute\simpleDispatcher(function (FastRoute\RouteCollector $r) {
    // An anonymous function endpoint
    $r->addRoute("GET", "/me", function (ServerRequestInterface $request, ResponseInterface $response) {
            // ...
    });

    // Class method endpoints
    $r->addRoute("GET", "/users", [UserController::class, "getUsers"]);
    $r->addRoute("POST", "/users/{id}", [UserController::class, "updateUser"]);
});
```

### Finally, launch the app:

[](#finally-launch-the-app)

```
use Laminas\Diactoros\Response;
use Laminas\Diactoros\ServerRequestFactory;
use Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
use WoohooLabs\Harmony\Harmony;
use WoohooLabs\Harmony\Middleware\DispatcherMiddleware;
use WoohooLabs\Harmony\Middleware\FastRouteMiddleware;
use WoohooLabs\Harmony\Middleware\LaminasEmitterMiddleware;

$harmony = new Harmony(ServerRequestFactory::fromGlobals(), new Response());
$harmony
    ->addMiddleware(new LaminasEmitterMiddleware(new SapiEmitter()))
    ->addMiddleware(new FastRouteMiddleware($router))
    ->addMiddleware(new DispatcherMiddleware())
    ->run();
```

You have to register all the prior middleware in order for the framework to function properly:

- `LaminasEmitterMiddleware` sends the response to the ether via [laminas-httphandlerrunner](https://github.com/laminas/laminas-httphandlerrunner)
- `FastRouteMiddleware` takes care of routing (`$router` was configured in the previous step)
- `DispatcherMiddleware` dispatches a controller which belongs to the request's current route

Note that there is a second optional argument of `Harmony::addMiddleware()` with which you can define the ID of a middleware (doing so is necessary if you want to call `Harmony::getMiddleware()` somewhere in your code).

Of course, it is completely up to you how you add additional middleware or how you replace them with your own implementations. When you'd like to go live, call `$harmony->run()`!

Advanced Usage
--------------

[](#advanced-usage)

### Using invokable class controllers

[](#using-invokable-class-controllers)

Most of the time, you will define your endpoints (~controller actions) as regular callables as shown in the section about the default router:

```
$router->addRoute("GET", "/users/me", [\App\Controllers\UserController::class, "getMe"]);
```

Nowadays, there is an increasing popularity of controllers containing only one action. In this case it is a general practice to implement the `__invoke()` magic method. When following this school of thought, your route definition can be simplified as seen below:

```
$router->addRoute("GET", "/users/me", \App\Controllers\GetMe::class);
```

Note: In case you use a different router or dispatcher than the default ones, please make sure if the feature is available for you.

If you are interested in how you could benefit from invokable controllers in the context of the Action-Domain-Responder pattern, you can find an insightful description in [Paul M. Jones' blog post](http://paul-m-jones.com/archives/6006).

### Using your favourite DI Container with Harmony

[](#using-your-favourite-di-container-with-harmony)

The motivation of creating Woohoo Labs. Harmony was to become able to change every single aspect of the framework. That's why you can use any DI Container you want.

For this purpose, we chose to build upon [PSR-11](https://www.php-fig.org/psr/psr-11/) - the most widespread common interface for DI Containers - in the built-in `DispatcherMiddleware`.

It's also important to know that the `DispatcherMiddleware` uses the `BasicContainer` by default. It's nothing more than a very silly DIC which tries to create objects based on their class name (so calling `$basicContainer->get(Foo::class)`would create a new `Foo` instance).

But if you provide an argument to the middleware's constructor, you can use your favourite PSR-11 compliant DI Container too. Let's have a look at an example where one would like to swap `BasicContainer` with [Zen](https://github.com/woohoolabs/zen):

```
$container = new MyContainer();
$harmony->addMiddleware(new DispatcherMiddleware($container));
```

### Creating custom middleware

[](#creating-custom-middleware)

New middleware also has to implement the [PSR-15](https://www.php-fig.org/psr/psr-15/) `MiddlewareInterface`. Let's see an example:

```
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Psr\Log\LoggerInterface;

class LoggerMiddleware implements MiddlewareInterface
{
    private LoggerInterface $logger;

    public function __construct(LoggerInterface $logger)
    {
        $this->logger = $logger;
    }

    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        // Perform logging before handling the request
        $this->logger->info("Request needs to be handled");

        // Invoking the remaining middleware
        $response = $handler->handle($request);

        // Perform logging after the request has been handled
        $this->logger->info("Request was successfully handled");

        // Return the response
        return $response;
    }
}
```

And when you are ready, attach it to Harmony:

```
$harmony->addMiddleware(new LoggerMiddleware(new Logger()));
```

What to do if you do not want to invoke the remaining middleware (possibly because of an error)? Then you can simply manipulate and return a response whose "prototype" was passed to the middleware in its constructor. You can see this in action in the following example:

```
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;

class AuthenticationMiddleware implements MiddlewareInterface
{
    protected string $apiKey;
    protected ResponseInterface $errorResponsePrototype;

    public function __construct(string $apiKey, ResponseInterface $errorResponsePrototype)
    {
        $this->apiKey = $apiKey;
        $this->errorResponsePrototype = $errorResponsePrototype;
    }

    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        // Return Error 401 "Unauthorized" if the provided API key doesn't match the expected one
        if ($request->getHeader("x-api-key") !== [$this->apiKey]) {
            return $this->errorResponsePrototype->withStatus(401);
        }

        // Invoke the remaining middleware if authentication was successful
        return $handler->handle($request);
    }
}
```

Then

```
$harmony->addMiddleware(new AuthenticationMiddleware("123"), new Response());
```

### Defining conditions

[](#defining-conditions)

Non-trivial applications often need some kind of branching during the execution of their middleware pipeline. A possible use-case is when they want to perform authentication only for some of their endpoints or when they want to check for a CSRF token if the request method is `POST`. With Harmony 2 branching was also easy to handle, but Harmony 3+ helps you to optimize the performance of conditional logic in your middleware.

Let's revisit our authentication middleware example from the last section! This time, we only want to authenticate endpoints below the `/users` path. In Harmony 2, we had to achieve it with something like this:

```
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;

class AuthenticationMiddleware implements MiddlewareInterface
{
    protected string $securedPath;
    protected MyAuthenticatorInterface $authenticator;
    protected ResponseInterface $errorResponsePrototype;

    public function __construct(string $securedPath, MyAuthenticatorInterface $authenticator, ResponseInterface $errorResponsePrototype)
    {
        $this->securedPath = $securedPath;
        $this->authenticator = $authenticator;
        $this->errorResponsePrototype = $errorResponsePrototype;
    }

    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        // Invoke the remaining middleware and cancel authentication if the current URL is for a public endpoint
        if (substr($request->getUri()->getPath(), 0, strlen($this->securedPath)) !== $this->securedPath) {
            return $handler->handle($request);
        }

        // Return Error 401 "Unauthorized" if authentication fails
        if ($this->authenticator->authenticate($request) === false) {
            return $this->errorResponsePrototype->withStatusCode(401);
        }

        // Invoke the remaining middleware otherwise
        return $handler->handle($request);
    }
}
```

And finally attach the middleware to Harmony:

```
$harmony->addMiddleware(new AuthenticationMiddleware("/users", new ApiKeyAuthenticator("123"), new Response()));
```

You had to check the current URI inside the middleware and the problem was solved. The downside of doing this is that `AuthenticationMiddleware` and all its dependencies are instantiated for each request even though authentication is not needed at all! This can be a major inconvenience if you depend on a big object graph.

In Harmony 3+, however, you are able to use conditions in order to optimize the number of invoked middleware. In this case you can utilize the built-in `PathPrefixCondition`. You only have to attach it to Harmony:

```
$harmony->addCondition(
    new PathPrefixCondition(["/users"]),
    static function (Harmony $harmony) {
        $harmony->addMiddleware(new AuthenticationMiddleware(new ApiKeyAuthenticator("123")));
    }
);
```

This way, `AuthenticationMiddleware` will only be instantiated when `PathPrefixCondition` evaluates to `true`(when the current URI path starts with `/users`). Furthermore, you are able to attach more middleware to Harmony in the anonymous function. They will be executed together, as if they were part of a containing middleware.

Here is the complete list of the built-in conditions:

- [`ExactPathCondition`](https://github.com/woohoolabs/harmony/blob/master/src/Condition/ExactPathCondition.php): Evaluates to true if the current URI path exactly matches any of the allowed paths.
- [`PathPrefixCondition`](https://github.com/woohoolabs/harmony/blob/master/src/Condition/PathPrefixCondition.php): Evaluates to true if the current URI path starts with any of the allowed path prefixes.
- [`HttpMethodCondition`](https://github.com/woohoolabs/harmony/blob/master/src/Condition/HttpMethodCondition.php): Evaluates to true if the current HTTP method matches any of the allowed HTTP methods.

Examples
--------

[](#examples)

If you want to see a really basic application structure in action, have a look at the [examples](https://github.com/woohoolabs/harmony/tree/master/examples). If `docker-compose` and `make` is available on your system, then run the following commands in order to try out the example app:

```
cp .env.dist .env      # You can now edit the settings in the .env file
make composer-install  # Install the Composer dependencies
make up                # Start the webserver
```

> If you don't have `make`, you can copy the underlying commands, and directly use them in your terminal.

Finally, the example app is available at `localhost:8080`.

> If you modified the `.env` file, you should change the port to the value of the `HOST_WEB_PORT` variable.

Example URIs:

- `GET /books/1`
- `GET /users/1`
- `GET /me`

When you finished your work, simply stop the webserver:

```
make down
```

If the prerequisites are not available for you, you have to set up a webserver on your host, install PHP, as well as the dependencies via `Composer`.

Versioning
----------

[](#versioning)

This library follows [SemVer v2.0.0](https://semver.org/).

Change Log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

Harmony has a PHPUnit test suite. To run the tests, run the following command from the project folder:

```
$ phpunit
```

Additionally, you may run `docker-compose up` or `make test` to execute the tests.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Support
-------

[](#support)

Please see [SUPPORT](SUPPORT.md) for details.

Credits
-------

[](#credits)

- [Máté Kocsis](https://github.com/kocsismate)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see the [License File](LICENSE) for more information.

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance60

Regular maintenance activity

Popularity42

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 96.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 ~89 days

Recently: every ~404 days

Total

42

Last Release

595d ago

Major Versions

3.1.0 → 4.0.02017-02-14

4.1.1 → 5.0.02018-02-02

5.1.0 → 6.0.02018-10-18

6.2.2 → 7.0.02019-12-29

7.1.3 → 8.0.02023-08-19

PHP version history (9 changes)0.1PHP &gt;=5.4.0

1.0.0PHP &gt;=5.5.0

2.2.0PHP ^5.5.0|^7.0.0

2.3.0PHP ^5.5.0||^7.0.0

3.1.0PHP ^7.0.0

4.1.0PHP ^7.1.0

6.2.0PHP ^7.4.0

7.1.2PHP ^7.4.0||^8.0.0

8.0.0PHP ^8.0.0

### Community

Maintainers

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

---

Top Contributors

[![kocsismate](https://avatars.githubusercontent.com/u/6057627?v=4)](https://github.com/kocsismate "kocsismate (504 commits)")[![userlond](https://avatars.githubusercontent.com/u/7788670?v=4)](https://github.com/userlond "userlond (3 commits)")[![holtkamp](https://avatars.githubusercontent.com/u/776405?v=4)](https://github.com/holtkamp "holtkamp (2 commits)")[![mtymek](https://avatars.githubusercontent.com/u/777893?v=4)](https://github.com/mtymek "mtymek (2 commits)")[![persianphilosopher](https://avatars.githubusercontent.com/u/11945003?v=4)](https://github.com/persianphilosopher "persianphilosopher (2 commits)")[![xabbuh](https://avatars.githubusercontent.com/u/1957048?v=4)](https://github.com/xabbuh "xabbuh (1 commits)")[![yarwest](https://avatars.githubusercontent.com/u/11287972?v=4)](https://github.com/yarwest "yarwest (1 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (1 commits)")[![superbull](https://avatars.githubusercontent.com/u/455630?v=4)](https://github.com/superbull "superbull (1 commits)")[![jnamenyi](https://avatars.githubusercontent.com/u/56647220?v=4)](https://github.com/jnamenyi "jnamenyi (1 commits)")[![marado](https://avatars.githubusercontent.com/u/33163?v=4)](https://github.com/marado "marado (1 commits)")[![mtelgkamp](https://avatars.githubusercontent.com/u/33117529?v=4)](https://github.com/mtelgkamp "mtelgkamp (1 commits)")

---

Tags

microframeworkmiddleware-dispatchersphppsr-11psr-15psr-7psr-7PSR-11frameworkpsr-15HarmonyWoohoo Labs.Middleware Dispatcher

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/woohoolabs-harmony/health.svg)

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[chubbyphp/chubbyphp-framework

A minimal, highly performant middleware PSR-15 microframework built with as little complexity as possible, aimed primarily at those developers who want to understand all the vendors they use.

13544.4k4](/packages/chubbyphp-chubbyphp-framework)[yiisoft/error-handler

Yii Error Handling Library

21363.6k15](/packages/yiisoft-error-handler)[igniphp/framework

Swoole, PSR-7, PSR-15 modular micro anti-framework.

2651.0k1](/packages/igniphp-framework)[antidot-fw/framework

Anti.Framework library

183.2k5](/packages/antidot-fw-framework)[phalcon/phalcon

Phalcon Framework

2421.5k1](/packages/phalcon-phalcon)

PHPackages © 2026

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