|
1 | 1 | # Moon - HTTP Middleware |
2 | | -A very simple HTTP Middleware implementation |
3 | 2 |
|
4 | 3 | [](https://scrutinizer-ci.com/g/moon-php/http-middleware/?branch=master) |
5 | 4 | [](https://scrutinizer-ci.com/g/moon-php/http-middleware/?branch=master) |
6 | 5 | [](https://scrutinizer-ci.com/g/moon-php/http-middleware/build-status/master) |
7 | | - |
8 | 6 | **Accpeted as [awesome psr-15 middleware](https://github.com/middlewares/awesome-psr15-middlewares#packages) package** |
9 | 7 |
|
10 | | -## Documentation |
11 | | - |
12 | | -- Delegate |
13 | | - |
14 | | -- InvalidArgumentException |
15 | | - |
16 | 8 |
|
| 9 | +### [Documentation](http://moon-php.com/docs/http-middleware/) |
17 | 10 |
|
18 | | -### Delegate |
| 11 | +## Tests |
19 | 12 |
|
20 | | -__namespace: Moon\HttpMiddleware\Delegate__ |
| 13 | +To execute the test suite, you'll need phpunit. |
| 14 | +_It's a dev-dependency of this package_ |
21 | 15 |
|
22 | | -According to the PSR15 proposal : |
| 16 | +```bash |
| 17 | +$ php vendon/bin/phpunit |
| 18 | +``` |
23 | 19 |
|
24 | | -_The DelegateInterface defines a single method that accepts a request and returns a response._ |
| 20 | +## Contributing |
25 | 21 |
|
26 | | -_The delegate interface must be implemented by any middleware dispatcher that uses middleware implementing MiddlewareInterface._ |
| 22 | +Please see [CONTRIBUTING](CONTRIBUTING.md) for details. |
27 | 23 |
|
28 | | -So i decided to make the **Delegate** a **Middleware Dispatcher** itself. |
| 24 | +## Learn More |
29 | 25 |
|
30 | | -The object is really simple, it has a constructor that requires an **array of MiddlewareInterface** implementor and a callable to use as **default** response. |
| 26 | +Learn more at these links: |
31 | 27 |
|
32 | | -The MiddlewareInterface implementor will be directly implemented by the userland and inserted into the array. |
| 28 | +- [Website](http://moon-php.com) |
33 | 29 |
|
34 | | - $request = new ServerRequestImplementor(); |
35 | | - $delegate = new Delegate([new MiddlewareOne(), new MiddlewareTwo(), new MiddlewareThree()], new DefaultResponse()); |
36 | | - $delegate->process($request); |
| 30 | +## Security |
37 | 31 |
|
38 | | -### InvalidArgumentException |
| 32 | +If you discover security related issues, please email [email protected] instead of using the issue tracker. |
39 | 33 |
|
40 | | -__namespace Moon\HttpMiddleware\Exception\InvalidArgumentException__ |
| 34 | +## License |
41 | 35 |
|
42 | | -If an object passed into the array is not a MiddlewareInterface implementor and **InvalidArgumentException** will be thrown. |
| 36 | +The Moon Http-Middleware is licensed under the MIT license. See [License File](LICENSE.md) for more information. |
0 commit comments