Skip to content

Commit

Permalink
Merge branch 'hotfix/readme-updates'
Browse files Browse the repository at this point in the history
Close #15
  • Loading branch information
weierophinney committed Nov 5, 2014
2 parents af4c33c + a91fd9d commit 45bfb27
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release..

## 0.8.2 - TBD
## 0.8.2 - 2014-11-05

### Added

Expand All @@ -18,7 +18,7 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- Nothing.
- `README.md` was updated to reference `OutgoingResponseInterface` instead of `ResponseInterface`.

## 0.8.1 - 2014-11-04

Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Installation and Requirements
Install this library using composer:

```console
$ composer require "psr/http-message:~0.3.0@dev" "phly/http:~1.0-dev@dev" "phly/conduit:~1.0-dev@dev"
$ composer require "psr/http-message:~0.5.1@dev" "phly/http:~1.0-dev@dev" "phly/conduit:~1.0-dev@dev"
```

Conduit has the following dependencies (which are managed by Composer):
Expand Down Expand Up @@ -170,7 +170,7 @@ In all cases, if you wish to implement typehinting, the signature is:
```php
function (
Psr\Http\Message\IncomingRequestInterface $request,
Psr\Http\Message\ResponseInterface $response,
Psr\Http\Message\OutgoingResponseInterface $response,
callable $next = null
) {
}
Expand All @@ -182,7 +182,7 @@ Error handler middleware has the following signature:
function (
$error, // Can be any type
Psr\Http\Message\IncomingRequestInterface $request,
Psr\Http\Message\ResponseInterface $response,
Psr\Http\Message\OutgoingResponseInterface $response,
callable $next
) {
}
Expand All @@ -193,7 +193,7 @@ Another approach is to extend the `Phly\Conduit\Middleware` class itself -- part
```php
use Phly\Conduit\Middleware;
use Psr\Http\Message\IncomingRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\OutgoingResponseInterface as Response;

class CustomMiddleware extends Middleware
{
Expand Down Expand Up @@ -246,7 +246,7 @@ class Middleware
public function pipe($path, $handler = null);
public function handle(
Psr\Http\Message\IncomingRequestInterface $request = null,
Psr\Http\Message\ResponseInterface $response = null,
Psr\Http\Message\OutgoingResponseInterface $response = null,
callable $out = null
);
}
Expand All @@ -273,9 +273,11 @@ Handlers are executed in the order in which they are piped to the `Middleware` i

`Phly\Conduit\Http\Request` acts as a decorator for a `Psr\Http\Message\IncomingRequestInterface` instance, and implements property overloading, allowing the developer to set and retrieve arbitrary properties other than those exposed via getters. This allows the ability to pass values between handlers.

Property overloading writes to the _attributes_ property of the incoming request, ensuring that the two are synchronized; in essence, it offers a convenience API to the various `(get|set)Attributes?()` methods.

#### Phly\Conduit\Http\Response

`Phly\Conduit\Http\Response` acts as a decorator for a `Psr\Http\Message\ResponseInterface` instance, and also implements `Phly\Conduit\Http\ResponseInterface`, which provides the following convenience methods:
`Phly\Conduit\Http\Response` acts as a decorator for a `Psr\Http\Message\OutgoingResponseInterface` instance, and also implements `Phly\Conduit\Http\ResponseInterface`, which provides the following convenience methods:

- `write()`, which proxies to the `write()` method of the composed response stream.
- `end()`, which marks the response as complete; it can take an optional argument, which, when provided, will be passed to the `write()` method. Once `end()` has been called, the response is immutable.
Expand Down

0 comments on commit 45bfb27

Please sign in to comment.