Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • AbstractEntityBodyDecorator
  • CachingEntityBody
  • Client
  • EntityBody
  • IoEmittingEntityBody
  • Mimetypes
  • QueryString
  • ReadLimitEntityBody
  • RedirectPlugin
  • Url

Interfaces

  • ClientInterface
  • EntityBodyInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
  1: <?php
  2: 
  3: namespace Guzzle\Http;
  4: 
  5: use Guzzle\Stream\Stream;
  6: 
  7: /**
  8:  * Abstract decorator used to wrap entity bodies
  9:  */
 10: class AbstractEntityBodyDecorator implements EntityBodyInterface
 11: {
 12:     /**
 13:      * @var EntityBodyInterface Decorated entity body
 14:      */
 15:     protected $body;
 16: 
 17:     /**
 18:      * Wrap an entity body
 19:      *
 20:      * @param EntityBodyInterface $body Entity body to decorate
 21:      */
 22:     public function __construct(EntityBodyInterface $body)
 23:     {
 24:         $this->body = $body;
 25:     }
 26: 
 27:     /**
 28:      * {@inheritdoc}
 29:      */
 30:     public function __toString()
 31:     {
 32:         return (string) $this->body;
 33:     }
 34: 
 35:     /**
 36:      * Allow decorators to implement custom methods
 37:      *
 38:      * @param string $method Missing method name
 39:      * @param array  $args   Method arguments
 40:      *
 41:      * @return mixed
 42:      */
 43:     public function __call($method, array $args = null)
 44:     {
 45:         return call_user_func_array(array($this->body, $method), $args);
 46:     }
 47: 
 48:     /**
 49:      * {@inheritdoc}
 50:      */
 51:     public function close()
 52:     {
 53:         return $this->body->close();
 54:     }
 55: 
 56:     /**
 57:      * {@inheritdoc}
 58:      */
 59:     public function setRewindFunction($callable)
 60:     {
 61:         $this->body->setRewindFunction($callable);
 62: 
 63:         return $this;
 64:     }
 65: 
 66:     /**
 67:      * {@inheritdoc}
 68:      */
 69:     public function rewind()
 70:     {
 71:         return $this->body->rewind();
 72:     }
 73: 
 74:     /**
 75:      * {@inheritdoc}
 76:      */
 77:     public function compress($filter = 'zlib.deflate')
 78:     {
 79:         return $this->body->compress($filter);
 80:     }
 81: 
 82:     /**
 83:      * {@inheritdoc}
 84:      */
 85:     public function uncompress($filter = 'zlib.inflate')
 86:     {
 87:         return $this->body->uncompress($filter);
 88:     }
 89: 
 90:     /**
 91:      * {@inheritdoc}
 92:      */
 93:     public function getContentLength()
 94:     {
 95:         return $this->getSize();
 96:     }
 97: 
 98:     /**
 99:      * {@inheritdoc}
100:      */
101:     public function getContentType()
102:     {
103:         return $this->body->getContentType();
104:     }
105: 
106:     /**
107:      * {@inheritdoc}
108:      */
109:     public function getContentMd5($rawOutput = false, $base64Encode = false)
110:     {
111:         $hash = Stream::getHash($this, 'md5', $rawOutput);
112: 
113:         return $hash && $base64Encode ? base64_encode($hash) : $hash;
114:     }
115: 
116:     /**
117:      * {@inheritdoc}
118:      */
119:     public function getContentEncoding()
120:     {
121:         return $this->body->getContentEncoding();
122:     }
123: 
124:     /**
125:      * {@inheritdoc}
126:      */
127:     public function getMetaData($key = null)
128:     {
129:         return $this->body->getMetaData($key);
130:     }
131: 
132:     /**
133:      * {@inheritdoc}
134:      */
135:     public function getStream()
136:     {
137:         return $this->body->getStream();
138:     }
139: 
140:     /**
141:      * {@inheritdoc}
142:      */
143:     public function setStream($stream, $size = 0)
144:     {
145:         $this->body->setStream($stream, $size);
146: 
147:         return $this;
148:     }
149: 
150:     /**
151:      * {@inheritdoc}
152:      */
153:     public function getWrapper()
154:     {
155:         return $this->body->getWrapper();
156:     }
157: 
158:     /**
159:      * {@inheritdoc}
160:      */
161:     public function getWrapperData()
162:     {
163:         return $this->body->getWrapperData();
164:     }
165: 
166:     /**
167:      * {@inheritdoc}
168:      */
169:     public function getStreamType()
170:     {
171:         return $this->body->getStreamType();
172:     }
173: 
174:     /**
175:      * {@inheritdoc}
176:      */
177:     public function getUri()
178:     {
179:         return $this->body->getUri();
180:     }
181: 
182:     /**
183:      * {@inheritdoc}
184:      */
185:     public function getSize()
186:     {
187:         return $this->body->getSize();
188:     }
189: 
190:     /**
191:      * {@inheritdoc}
192:      */
193:     public function isReadable()
194:     {
195:         return $this->body->isReadable();
196:     }
197: 
198:     /**
199:      * {@inheritdoc}
200:      */
201:     public function isWritable()
202:     {
203:         return $this->body->isWritable();
204:     }
205: 
206:     /**
207:      * {@inheritdoc}
208:      */
209:     public function isConsumed()
210:     {
211:         return $this->body->isConsumed();
212:     }
213: 
214:     /**
215:      * Alias of isConsumed()
216:      * {@inheritdoc}
217:      */
218:     public function feof()
219:     {
220:         return $this->isConsumed();
221:     }
222: 
223:     /**
224:      * {@inheritdoc}
225:      */
226:     public function isLocal()
227:     {
228:         return $this->body->isLocal();
229:     }
230: 
231:     /**
232:      * {@inheritdoc}
233:      */
234:     public function isSeekable()
235:     {
236:         return $this->body->isSeekable();
237:     }
238: 
239:     /**
240:      * {@inheritdoc}
241:      */
242:     public function setSize($size)
243:     {
244:         $this->body->setSize($size);
245: 
246:         return $this;
247:     }
248: 
249:     /**
250:      * {@inheritdoc}
251:      */
252:     public function seek($offset, $whence = SEEK_SET)
253:     {
254:         return $this->body->seek($offset, $whence);
255:     }
256: 
257:     /**
258:      * {@inheritdoc}
259:      */
260:     public function read($length)
261:     {
262:         return $this->body->read($length);
263:     }
264: 
265:     /**
266:      * {@inheritdoc}
267:      */
268:     public function write($string)
269:     {
270:         return $this->body->write($string);
271:     }
272: 
273:     /**
274:      * {@inheritdoc}
275:      */
276:     public function readLine($maxLength = null)
277:     {
278:         return $this->body->readLine($maxLength);
279:     }
280: 
281:     /**
282:      * {@inheritdoc}
283:      */
284:     public function ftell()
285:     {
286:         return $this->body->ftell();
287:     }
288: 
289:     /**
290:      * {@inheritdoc}
291:      */
292:     public function getCustomData($key)
293:     {
294:         return $this->body->getCustomData($key);
295:     }
296: 
297:     /**
298:      * {@inheritdoc}
299:      */
300:     public function setCustomData($key, $value)
301:     {
302:         $this->body->setCustomData($key, $value);
303: 
304:         return $this;
305:     }
306: }
307: 
php-coveralls API documentation generated by ApiGen 2.8.0