Skip to content

Commit

Permalink
remove Diactoros dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
sasezaki committed Oct 30, 2015
1 parent 66a3c87 commit 86e97ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"php": ">=5.5.0",
"psr/http-message": "^1.0.0",
"nikic/fast-route": "^0.6",
"zendframework/zend-diactoros": "^1.1",
"struggle-for-php/sfp-stream-view": "^0.1.0"
},
"require-dev": {
"zendframework/zend-diactoros": "^1.1",
"phpunit/phpunit": "~4.6",
"satooshi/php-coveralls": "~0.6"
},
Expand Down
6 changes: 2 additions & 4 deletions src/Backbeard/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@

use SfpStreamView\View as BaseView;
use Psr\Http\Message\ResponseInterface;
use Zend\Diactoros\Stream;

class View extends BaseView implements ViewInterface
{
public function marshalResponse(ViewModelInterface $model, ResponseInterface $response)
{
$template = $model->getTemplate();
$vars = $model->getVariables();
$stream = $response->getBody()->detach();

$this->assign($vars);
$this->render($template, $stream);
$this->renderResponse($template, $response);

return $response->withBody(new Stream($stream));
return $response;
}
}

0 comments on commit 86e97ac

Please sign in to comment.