rougin/onion

HTTP middlewares for Slytherin.

dev-master 2025-07-05 08:18 UTC

This package is auto-updated.

Last update: 2025-07-05 08:22:35 UTC


README

A collection of Slytherin-based HTTP middlewares.

Installation

Install the package using Composer:

$ composer require rougin/onion

Middlewares

Rougin\Onion\FormParser

  • Parses input request coming from php:://input.

Rougin\Onion\BodyParams

  • Parses input request from complex HTTP methods (DELETE, PATCH, PUT).

Rougin\Onion\NullString

  • Converts null string as a null literal.

Rougin\Onion\CorsHeader

Rougin\Onion\JsonHeader

  • Changes the content response to application/json.

Change log

See CHANGELOG for more recent changes.

Development

Includes tools for code quality, coding style, and unit tests.

Code quality

Analyze code quality using phpstan:

$ phpstan

Coding style

Enforce coding style using php-cs-fixer:

$ php-cs-fixer fix --config=phpstyle.php

Unit tests

Execute unit tests using phpunit:

$ composer test