ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
MessageDecoratorTrait.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\HTTP;
4
17
25 protected $inner;
26
35 function getBodyAsStream() {
36
37 return $this->inner->getBodyAsStream();
38
39 }
40
49 function getBodyAsString() {
50
51 return $this->inner->getBodyAsString();
52
53 }
54
62 function getBody() {
63
64 return $this->inner->getBody();
65
66 }
67
74 function setBody($body) {
75
76 $this->inner->setBody($body);
77
78 }
79
87 function getHeaders() {
88
89 return $this->inner->getHeaders();
90
91 }
92
99 function hasHeader($name) {
100
101 return $this->inner->hasHeader($name);
102
103 }
104
121 function getHeader($name) {
122
123 return $this->inner->getHeader($name);
124
125 }
126
139
140 return $this->inner->getHeaderAsArray($name);
141
142 }
143
155 function setHeader($name, $value) {
156
157 $this->inner->setHeader($name, $value);
158
159 }
160
172 function setHeaders(array $headers) {
173
174 $this->inner->setHeaders($headers);
175
176 }
177
189 function addHeader($name, $value) {
190
191 $this->inner->addHeader($name, $value);
192
193 }
194
203 function addHeaders(array $headers) {
204
205 $this->inner->addHeaders($headers);
206
207 }
208
209
220 function removeHeader($name) {
221
222 return $this->inner->removeHeader($name);
223
224 }
225
235
236 $this->inner->setHttpVersion($version);
237
238 }
239
245 function getHttpVersion() {
246
247 return $this->inner->getHttpVersion();
248
249 }
250
251}
$version
Definition: build.php:27
An exception for terminatinating execution or to throw for unit testing.
getHeaders()
Returns all the HTTP headers as an array.
getBodyAsString()
Returns the body as a string.
getHeaderAsArray($name)
Returns a HTTP header as an array.
addHeader($name, $value)
Adds a HTTP header.
setHttpVersion($version)
Sets the HTTP version.
trait MessageDecoratorTrait
This trait contains a bunch of methods, shared by both the RequestDecorator and the ResponseDecorator...
getBody()
Returns the message body, as it's internal representation.
getHttpVersion()
Returns the HTTP version.
hasHeader($name)
Will return true or false, depending on if a HTTP header exists.
addHeaders(array $headers)
Adds a new set of HTTP headers.
setBody($body)
Updates the body resource with a new stream.
setHeader($name, $value)
Updates a HTTP header.
setHeaders(array $headers)
Sets a new set of HTTP headers.
getHeader($name)
Returns a specific HTTP header, based on it's name.
removeHeader($name)
Removes a HTTP header.
getBodyAsStream()
Returns the body as a readable stream resource.