public function adapt(array $tokens = [], $status = 200, array $headers = []) { list($contentType, $body) = $this->encoder->encode($this->request->getHeader('Accept'), $tokens); return new Response($this->asStream($body), $status, $this->getHeadersForResponse($contentType, $headers)); }
public function adapt(array $tokens = [], $status = 200, array $headers = []) { list($contentType, $body) = $this->encoder->encode($this->request->headers->get('Accept'), $tokens); $responseClass = $this->getResponseClassName(); return new $responseClass($body, $status, $this->getHeadersForResponse($contentType, $headers)); }
private function execute($accept) { $encoder = new OAuthTokenEncoder(); return $encoder->encode($accept, self::TOKENS); }