Skip to content

Commit e5563ae

Browse files
committed
First implementation
1 parent 09b606f commit e5563ae

18 files changed

Lines changed: 4302 additions & 1 deletion

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
.idea
3+
phpunit.xml
4+
vendor
5+
coverage
6+
clover.xml
7+
.phpunit*

.travis.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
language: php
2+
dist: trusty
3+
4+
php:
5+
- 7.3.0
6+
7+
install:
8+
- composer install
9+
10+
jobs:
11+
include:
12+
- stage: "Tests"
13+
name: "Unit tests"
14+
script: "./vendor/bin/phpunit"
15+
- stage: "Static Code Analysis"
16+
name: "Static Analyze"
17+
script: "vendor/bin/phpstan analyse -l max src --no-interaction --no-progress"
18+
- name: "Linter"
19+
script: "vendor/bin/phpcs --standard=PSR2 ./src/"
20+
21+
after_success:
22+
- bash <(curl -s https://codecov.io/bash)

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Maxime Elomari
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,31 @@
11
# middleware-collection-request-handler
2-
Simple PSR-15 middleware collection request handler.
2+
3+
A simple PSR-15 server request handler implementation to handle middleware collection.
4+
5+
![PHP from Packagist](https://img.shields.io/packagist/php-v/noglitchyo/middleware-collection-request-handler.svg)
6+
[![Build Status](https://travis-ci.org/noglitchyo/middleware-collection-request-handler.svg?branch=master)](https://travis-ci.org/noglitchyo/middleware-collection-request-handler)
7+
[![codecov](https://codecov.io/gh/noglitchyo/middleware-collection-request-handler/branch/master/graph/badge.svg)](https://codecov.io/gh/noglitchyo/middleware-collection-request-handler)
8+
![Scrutinizer code quality (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/quality/g/noglitchyo/middleware-collection-request-handler.svg)
9+
![Packagist](https://img.shields.io/packagist/l/noglitchyo/middleware-collection-request-handler.svg)
10+
11+
### Description
12+
13+
Request handler implementing the [RequestHandlerInterface](https://github.com/php-fig/http-server-handler/blob/master/src/RequestHandlerInterface.php)
14+
and able to manage a collection of middlewares implementing the [MiddlewareInterface](https://github.com/php-fig/http-server-middleware/blob/master/src/MiddlewareInterface.php).
15+
16+
This middleware attempts to provide interoperability to process a collection middlewares and
17+
offer the possibility to define the strategy on how middlewares are fetched.
18+
19+
### Getting started
20+
21+
#### Installation
22+
23+
`composer require noglitchyo/middleware-collection-request-handler`
24+
25+
#### Tests
26+
27+
`composer test`
28+
29+
### References
30+
31+
https://www.php-fig.org/psr/psr-15/

composer.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "noglitchyo/middleware-collection-request-handler",
3+
"description": "Simple PSR-15 middleware collection request handler.",
4+
"type": "library",
5+
"require": {
6+
"php": ">=7.3",
7+
"psr/http-server-middleware": "^1.0",
8+
"psr/http-message": "^1.0",
9+
"nyholm/psr7-server": "^0.3.0",
10+
"nyholm/psr7": "^1.1"
11+
},
12+
"require-dev": {
13+
"phpunit/phpunit": "^8.1",
14+
"squizlabs/php_codesniffer": "*",
15+
"phpstan/phpstan": "^0.11.8"
16+
},
17+
"license": "MIT",
18+
"authors": [
19+
{
20+
"name": "Maxime Elomari",
21+
"email": "maxime.elomari@gmail.com"
22+
}
23+
],
24+
"autoload": {
25+
"psr-4": {
26+
"NoGlitchYo\\MiddlewareCollectionRequestHandler\\": "src/"
27+
}
28+
},
29+
"autoload-dev": {
30+
"psr-4": {
31+
"NoGlitchYo\\MiddlewareCollectionRequestHandler\\Tests\\": "tests/"
32+
}
33+
},
34+
"scripts": {
35+
"phpstan": "phpstan analyse -l max src",
36+
"phpcs": "phpcs --standard=PSR2 ./src/",
37+
"test": "phpunit phpunit.dist.xml"
38+
}
39+
}

0 commit comments

Comments
 (0)