File tree 1 file changed +4
-20
lines changed
1 file changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -171,27 +171,11 @@ function getSnippetFooterSync (includeRequestOptions) {
171
171
*/
172
172
function getSnippetFooterAsync ( includeRequestOptions ) {
173
173
if ( ! includeRequestOptions ) {
174
- return '$promise = $client->sendAsync($request);\n' +
175
- '$promise->then(\n' +
176
- ' function (ResponseInterface $res) {\n' +
177
- ' echo $res->getBody();\n' +
178
- ' },\n' +
179
- ' function (RequestException $e) {\n' +
180
- ' echo $e->getMessage();\n' +
181
- ' echo $e->getRequest()->getMethod();\n' +
182
- ' }\n' +
183
- ');\n' ;
174
+ return '$res = $client->sendAsync($request)->wait();\n' +
175
+ 'echo $res->getBody();\n' ;
184
176
}
185
- return '$promise = $client->sendAsync($request, $options);\n' +
186
- '$promise->then(\n' +
187
- ' function (ResponseInterface $res) {\n' +
188
- ' echo $res->getBody();\n' +
189
- ' },\n' +
190
- ' function (RequestException $e) {\n' +
191
- ' echo $e->getMessage();\n' +
192
- ' echo $e->getRequest()->getMethod();\n' +
193
- ' }\n' +
194
- ');\n' ;
177
+ return '$res = $client->sendAsync($request, $options)->wait();\n' +
178
+ 'echo $res->getBody();\n' ;
195
179
}
196
180
197
181
/**
You can’t perform that action at this time.
0 commit comments