Skip to content

Commit

Permalink
Merge pull request #413 from php-http/adjust-formatter
Browse files Browse the repository at this point in the history
implement formatResponseForRequest
  • Loading branch information
dbu authored Mar 17, 2022
2 parents 2b5dd81 + ec92e1b commit b924cf6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
php-version: "7.3"
dependency-versions: "lowest"
symfony-deprecations-helper: "weak"
stability: "stable"

# Test the latest stable release
- dependencies: "php-http/guzzle7-adapter php-http/vcr-plugin:^1.0@dev"
Expand Down
9 changes: 9 additions & 0 deletions src/Collector/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ public function formatRequest(RequestInterface $request)
return $this->formatter->formatRequest($request);
}

public function formatResponseForRequest(ResponseInterface $response, RequestInterface $request)
{
if (method_exists($this->formatter, 'formatResponseForRequest')) {
return $this->formatter->formatResponseForRequest($response, $request);
}

return $this->formatter->formatResponse($response);
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit b924cf6

Please sign in to comment.