Skip to content

Commit 1389c3a

Browse files
committed
Comment code
1 parent b1998a8 commit 1389c3a

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/WaterPipe/HTTP/Response/Response.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ public function send()
8383
$this->close();
8484
}
8585

86-
public function sendHeaders() : self
86+
/**
87+
* Sends only headers of this response to the client.
88+
* This will assume that the response body was not sent before.
89+
*
90+
* @return self
91+
*/
92+
public function sendHeaders(): self
8793
{
8894
// Set status code
8995
$code = $this->_status->getCode();
@@ -108,7 +114,12 @@ public function sendHeaders() : self
108114
return $this;
109115
}
110116

111-
public function sendBody() : self
117+
/**
118+
* Sends this response body to the client.
119+
*
120+
* @return self
121+
*/
122+
public function sendBody(): self
112123
{
113124
// Print the body
114125
echo $this->_body;
@@ -216,6 +227,11 @@ public function sendFile(string $path, int $status = ResponseStatus::OkCode, str
216227
}
217228
}
218229

230+
/**
231+
* Properly closes this response and exit the application.
232+
*
233+
* @return void
234+
*/
219235
public function close()
220236
{
221237
exit(0);

0 commit comments

Comments
 (0)