Created
June 7, 2017 20:17
-
-
Save iampersistent/097c5d0a92fee1dce506152a3a198811 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PSR7Connector | |
{ | |
public function fromTheOutside($prs7) | |
{ | |
$this->transformerFriendly = $psr7->getBody()->getContents(); | |
} | |
public function dataForTransformer(): array | |
{ | |
return $this->transformerFriendly; | |
} | |
public function dataFromTransformer(mixed $transformed) | |
{ | |
$this->transformed = $transformed; | |
} | |
public function backToTheOutside(): ResponseInterface | |
{ | |
return (new Response())->withBody($this->transformed); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment