rougin / onion
HTTP middlewares for Slytherin.
dev-master
2025-07-05 08:18 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: ~4.2|~5.7|~6.0|~7.0|~8.0|~9.0
- sanmai/phpunit-legacy-adapter: ~6.1|~8.0
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 anull
literal.
Rougin\Onion\CorsHeader
- Adds additional headers for Cross-origin resource sharing (CORS).
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