mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Correct return statements in SS_HTTPResponse
- setBody failed to return a value; it now returns $this as related methods do - getHeader had an extra, unreachable return statement; removed
This commit is contained in:
parent
1f695df952
commit
5047143e7b
@ -161,6 +161,7 @@ class SS_HTTPResponse {
|
|||||||
*/
|
*/
|
||||||
public function setBody($body) {
|
public function setBody($body) {
|
||||||
$this->body = $body ? (string)$body : $body; // Don't type-cast false-ish values, eg null is null not ''
|
$this->body = $body ? (string)$body : $body; // Don't type-cast false-ish values, eg null is null not ''
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -191,7 +192,6 @@ class SS_HTTPResponse {
|
|||||||
public function getHeader($header) {
|
public function getHeader($header) {
|
||||||
if(isset($this->headers[$header]))
|
if(isset($this->headers[$header]))
|
||||||
return $this->headers[$header];
|
return $this->headers[$header];
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user