Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
FutureResponse.php
001 <?php
002 namespace GuzzleHttp\Message;
003
004 use GuzzleHttp\Ring\Future\MagicFutureTrait;
005 use GuzzleHttp\Ring\Future\FutureInterface;
006 use GuzzleHttp\Stream\StreamInterface;
007
008 /**
009 * Represents a response that has not been fulfilled.
010 *
011 * When created, you must provide a function that is used to dereference the
012 * future result and return it's value. The function has no arguments and MUST
013 * return an instance of a {@see GuzzleHttp\Message\ResponseInterface} object.
014 *
015 * You can optionally provide a function in the constructor that can be used to
016 * cancel the future from completing if possible. This function has no
017 * arguments and returns a boolean value representing whether or not the
018 * response could be cancelled.
019 *
020 * @property ResponseInterface $_value
021 */
022 class FutureResponse implements ResponseInterface, FutureInterface
023 {
024 use MagicFutureTrait;
025
026 /**
027 * Returns a FutureResponse that wraps another future.
028 *
029 * @param FutureInterface $future Future to wrap with a new future
030 * @param callable $onFulfilled Invoked when the future fulfilled
031 * @param callable $onRejected Invoked when the future rejected
032 * @param callable $onProgress Invoked when the future progresses
033 *
034 * @return FutureResponse
035 */
036 public static function proxy(
037 FutureInterface $future,
038 callable $onFulfilled = null,
039 callable $onRejected = null,
040 callable $onProgress = null
041 ) {
042 return new FutureResponse(
043 $future->then($onFulfilled, $onRejected, $onProgress),
044 [$future, 'wait'],
045 [$future, 'cancel']
046 );
047 }
048
049 public function getStatusCode()
050 {
051 return $this->_value->getStatusCode();
052 }
053
054 public function setStatusCode($code)
055 {
056 $this->_value->setStatusCode($code);
057 }
058
059 public function getReasonPhrase()
060 {
061 return $this->_value->getReasonPhrase();
062 }
063
064 public function setReasonPhrase($phrase)
065 {
066 $this->_value->setReasonPhrase($phrase);
067 }
068
069 public function getEffectiveUrl()
070 {
071 return $this->_value->getEffectiveUrl();
072 }
073
074 public function setEffectiveUrl($url)
075 {
076 $this->_value->setEffectiveUrl($url);
077 }
078
079 public function json(array $config = [])
080 {
081 return $this->_value->json($config);
082 }
083
084 public function xml(array $config = [])
085 {
086 return $this->_value->xml($config);
087 }
088
089 public function __toString()
090 {
091 try {
092 return $this->_value->__toString();
093 } catch (\Exception $e) {
094 trigger_error($e->getMessage(), E_USER_WARNING);
095 return '';
096 }
097 }
098
099 public function getProtocolVersion()
100 {
101 return $this->_value->getProtocolVersion();
102 }
103
104 public function setBody(StreamInterface $body = null)
105 {
106 $this->_value->setBody($body);
107 }
108
109 public function getBody()
110 {
111 return $this->_value->getBody();
112 }
113
114 public function getHeaders()
115 {
116 return $this->_value->getHeaders();
117 }
118
119 public function getHeader($header)
120 {
121 return $this->_value->getHeader($header);
122 }
123
124 public function getHeaderAsArray($header)
125 {
126 return $this->_value->getHeaderAsArray($header);
127 }
128
129 public function hasHeader($header)
130 {
131 return $this->_value->hasHeader($header);
132 }
133
134 public function removeHeader($header)
135 {
136 $this->_value->removeHeader($header);
137 }
138
139 public function addHeader($header, $value)
140 {
141 $this->_value->addHeader($header, $value);
142 }
143
144 public function addHeaders(array $headers)
145 {
146 $this->_value->addHeaders($headers);
147 }
148
149 public function setHeader($header, $value)
150 {
151 $this->_value->setHeader($header, $value);
152 }
153
154 public function setHeaders(array $headers)
155 {
156 $this->_value->setHeaders($headers);
157 }
158 }
159