Skip to content

Commit

Permalink
prefer $ro over $resourceObject
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Oct 15, 2018
1 parent f4001fe commit f5cdc35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/Provide/Transfer/HttpResponder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ class HttpResponder implements TransferInterface
/**
* {@inheritdoc}
*/
public function __invoke(ResourceObject $resourceObject, array $server)
public function __invoke(ResourceObject $ro, array $server)
{
unset($server);
// render
if (! $resourceObject->view) {
$resourceObject->toString();
if (! $ro->view) {
$ro->toString();
}

// header
foreach ($resourceObject->headers as $label => $value) {
foreach ($ro->headers as $label => $value) {
header("{$label}: {$value}", false);
}

// code
http_response_code($resourceObject->code);
http_response_code($ro->code);

// body
echo $resourceObject->view;
echo $ro->view;
}
}
4 changes: 2 additions & 2 deletions tests/Fake/Provide/Transfer/FakeHttpResponder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public static function reset()
static::$content = null;
}

public function __invoke(ResourceObject $resourceObject, array $server)
public function __invoke(ResourceObject $ro, array $server)
{
ob_start();
parent::__invoke($resourceObject, $server);
parent::__invoke($ro, $server);
$body = ob_get_clean();
self::$content = $body;
}
Expand Down

0 comments on commit f5cdc35

Please sign in to comment.