diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2014-03-09 23:01:16 +0100 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2014-03-09 23:01:16 +0100 |
commit | 8f6ea900f2f75bfdfadb7f484ec64ac7ea78623c (patch) | |
tree | 4d542871564df3e12db36cc83a8dfd2ea9f0f88c /lib/public | |
parent | 9a31e533130ed6902719051bb854d0994d6ff86b (diff) | |
download | nextcloud-server-8f6ea900f2f75bfdfadb7f484ec64ac7ea78623c.tar.gz nextcloud-server-8f6ea900f2f75bfdfadb7f484ec64ac7ea78623c.zip |
Chainable Response in AppFramework
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/appframework/http/jsonresponse.php | 2 | ||||
-rw-r--r-- | lib/public/appframework/http/response.php | 9 | ||||
-rw-r--r-- | lib/public/appframework/http/templateresponse.php | 4 |
3 files changed, 15 insertions, 0 deletions
diff --git a/lib/public/appframework/http/jsonresponse.php b/lib/public/appframework/http/jsonresponse.php index b54b23a34e6..bcfe469ef1b 100644 --- a/lib/public/appframework/http/jsonresponse.php +++ b/lib/public/appframework/http/jsonresponse.php @@ -69,6 +69,8 @@ class JSONResponse extends Response { */ public function setData($data){ $this->data = $data; + + return $this; } diff --git a/lib/public/appframework/http/response.php b/lib/public/appframework/http/response.php index d223621d4fd..e704acca7f0 100644 --- a/lib/public/appframework/http/response.php +++ b/lib/public/appframework/http/response.php @@ -80,6 +80,7 @@ class Response { $this->addHeader('Cache-Control', 'no-cache, must-revalidate'); } + return $this; } @@ -95,6 +96,8 @@ class Response { } else { $this->headers[$name] = $value; } + + return $this; } @@ -133,6 +136,8 @@ class Response { */ public function setStatus($status) { $this->status = $status; + + return $this; } @@ -168,6 +173,8 @@ class Response { */ public function setETag($ETag) { $this->ETag = $ETag; + + return $this; } @@ -177,6 +184,8 @@ class Response { */ public function setLastModified($lastModified) { $this->lastModified = $lastModified; + + return $this; } diff --git a/lib/public/appframework/http/templateresponse.php b/lib/public/appframework/http/templateresponse.php index 2200a38beca..1ae22dde7ff 100644 --- a/lib/public/appframework/http/templateresponse.php +++ b/lib/public/appframework/http/templateresponse.php @@ -77,6 +77,8 @@ class TemplateResponse extends Response { */ public function setParams(array $params){ $this->params = $params; + + return $this; } @@ -107,6 +109,8 @@ class TemplateResponse extends Response { */ public function renderAs($renderAs){ $this->renderAs = $renderAs; + + return $this; } |