Skip to content

Commit

Permalink
Updated CHANGELOG for v0.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
victorwelling committed Feb 5, 2018
1 parent 348ece5 commit 8ef4d4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All notable changes to Shoot will be documented in this file.

## [0.4.0] - 2018-02-05
- Removed Context type entirely. We'll have to settle for typing through PHPDoc, until maybe we one day have generics.

## [0.3.0] - 2018-02-01
- Context is now interfaced, in preparation of the Shoot/Http package. This package will make use of Shoot in an HTTP
context (PSR-7 and PSR-15) easier.
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ available to all middleware and presenters. You'll see how it's used further dow

```php
$app->get('/posts/{post_id}', function ($request, $response) {
$context = new Context([ServerRequestInterface::class => $request]);

return $this
->get(Pipeline::class)
->withContext($context, function () use ($response) {
->withContext($request, function () use ($response) {
return $this->view->render($response, 'post.twig');
});
});
Expand Down Expand Up @@ -124,7 +122,7 @@ final class PostPresenter implements PresenterInterface
$this->router = $router;
}

public function present(Context $context, PresentationModel $presentationModel): PresentationModel
public function present($context, PresentationModel $presentationModel): PresentationModel
{
$request = $context->getAttribute(ServerRequestInterface::class);
$postId = $request->getAttribute('post_id', '');
Expand Down

0 comments on commit 8ef4d4f

Please sign in to comment.