/var/www/vhosts/ihelp.ro/httpdocs/vendor/laminas/laminas-diactoros/src/Response
NameSizeModeActions
ArraySerializer.php27940644editdlrm
EmptyResponse.php8850644editdlrm
HtmlResponse.php20620644editdlrm
InjectContentTypeTrait.php7420644editdlrm
JsonResponse.php44850644editdlrm
RedirectResponse.php13770644editdlrm
Serializer.php30860644editdlrm
TextResponse.php20710644editdlrm
XmlResponse.php20870644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/laminas/laminas-diactoros/src/Response/ArraySerializer.php (2794B)
>, * body: string * } */ public static function toArray(ResponseInterface $response): array { return [ 'status_code' => $response->getStatusCode(), 'reason_phrase' => $response->getReasonPhrase(), 'protocol_version' => $response->getProtocolVersion(), 'headers' => $response->getHeaders(), 'body' => (string) $response->getBody(), ]; } /** * Deserialize a response array to a response instance. * * @throws Exception\DeserializationException When cannot deserialize response. */ public static function fromArray(array $serializedResponse): Response { try { $body = new Stream('php://memory', 'wb+'); $body->write(self::getValueFromKey($serializedResponse, 'body')); $statusCode = self::getValueFromKey($serializedResponse, 'status_code'); $headers = self::getValueFromKey($serializedResponse, 'headers'); $protocolVersion = self::getValueFromKey($serializedResponse, 'protocol_version'); $reasonPhrase = self::getValueFromKey($serializedResponse, 'reason_phrase'); return (new Response($body, $statusCode, $headers)) ->withProtocolVersion($protocolVersion) ->withStatus($statusCode, $reasonPhrase); } catch (Throwable $exception) { throw Exception\DeserializationException::forResponseFromArray($exception); } } /** * @return mixed * @throws Exception\DeserializationException */ private static function getValueFromKey(array $data, string $key, ?string $message = null) { if (isset($data[$key])) { return $data[$key]; } if ($message === null) { $message = sprintf('Missing "%s" key in serialized response', $key); } throw new Exception\DeserializationException($message); } }