Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Updated return type of host method to HostMiddlewareDecorator
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbundyra committed Jan 19, 2018
1 parent 5310190 commit a972bda
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions docs/book/v3/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,22 @@ inner layers.

Stratigility provides the following utility functions.

### host

```php
function Zend\Stratigility\host(
string $host,
Psr\Http\Server\MiddlewareInterface $middleware
) : Zend\Stratigility\Middleware\HostMiddlewareDecorator
```

`host()` provides a convenient way to perform host name segregation when piping your
middleware.

```php
$pipeline->pipe(host('example.com', $middleware));
```

### path

````
Expand Down
2 changes: 1 addition & 1 deletion docs/book/v3/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Release 3.0 adds the following utility functions:
function Zend\Stratigility\host(
string $host,
Psr\Http\Server\MiddlewareInterface $middleware
): Psr\Http\Server\MiddlewareInterface
) : Zend\Stratigility\Middleware\HostMiddlewareDecorator
```

This is a convenience wrapper around instantiation of a
Expand Down
2 changes: 1 addition & 1 deletion src/functions/host.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* $pipeline->pipe(host('host.foo', $middleware));
* </code>
*/
function host(string $host, MiddlewareInterface $middleware) : MiddlewareInterface
function host(string $host, MiddlewareInterface $middleware) : Middleware\HostMiddlewareDecorator
{
return new Middleware\HostMiddlewareDecorator($host, $middleware);
}

0 comments on commit a972bda

Please sign in to comment.