Skip to content

Commit

Permalink
change modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
recca0120 committed Aug 24, 2022
1 parent 21fc348 commit 1eecfc4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/ResponseIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ public static function fromMessage(string $message): self
return new self($data['body'], (int) $parts[1], $data['headers']);
}

public function toMessage(): string
{
return (string) $this->toResponse();
}

public function toResponse(): Response
{
return new Response($this->content, $this->status, $this->headers);
}

/**
* Parses an HTTP message into an associative array.
*
Expand All @@ -68,7 +78,7 @@ public static function fromMessage(string $message): self
*
* @param string $message HTTP request or response to parse.
*/
public static function parseMessage(string $message): array
private static function parseMessage(string $message): array
{
if (! $message) {
throw new InvalidArgumentException('Invalid message');
Expand Down Expand Up @@ -122,14 +132,4 @@ public static function parseMessage(string $message): array
'body' => $body,
];
}

public function toMessage(): string
{
return (string) $this->toResponse();
}

public function toResponse(): Response
{
return new Response($this->content, $this->status, $this->headers);
}
}

0 comments on commit 1eecfc4

Please sign in to comment.