Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
Joan Fabrégat committed Sep 24, 2018
1 parent 3d9a5af commit b009332
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
25 changes: 4 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
# PSR-15 middleware dispatcher
# CollectionInterface

`codeinc/middleware-dispatcher` is a [PSR-15](https://www.php-fig.org/psr/psr-15/) middleware dispatcher. The middleware dispatcher behaves as a PSR-15 [`RequestHandlerInterface`](https://www.php-fig.org/psr/psr-15/#21-psrhttpserverrequesthandlerinterface).

## Usage

```php
<?php
use CodeInc\MiddlewareDispatcher\MiddlewareDispatcher;

$middlewareDispatcher = new MiddlewareDispatcher();

// adding the middleware
$middlewareDispatcher->addMiddleware(new MyFirstMiddleware);
$middlewareDispatcher->addMiddleware(new MySecondMiddleware);
$middlewareDispatcher->addMiddleware(new MyThirdMiddleware);

// handling the request
$psr7Response = $middlewareDispatcher->handle($psr7ServerRequest);
```
The repository provides a simple PHP interface for iterable collections.

## Installation

This library is available through [Packagist](https://packagist.org/packages/codeinc/middleware-dispatcher) and can be installed using [Composer](https://getcomposer.org/):
This library is available through [Packagist](https://packagist.org/packages/codeinc/collection-interface) and can be installed using [Composer](https://getcomposer.org/):

```bash
composer require codeinc/middleware-dispatcher
composer require codeinc/collection-interface
```


Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "codeinc/collection-interface",
"version": "1.0.0",
"description": "A simple iterable PHP collection",
"description": "A simple PHP interface for iterable collections",
"homepage": "https://github.com/CodeIncHQ/CollectionInterface",
"type": "library",
"license": "MIT",
Expand Down

0 comments on commit b009332

Please sign in to comment.