YoastSEO_Vendor\GuzzleHttp\Handler
CurlFactory::finish() public Yoast 1.0
Completes a cURL transaction, either returning a response promise or a rejected promise.
{} Это метод класса: CurlFactory{}
Хуков нет.
Возвращает
\GuzzleHttp\Promise\PromiseInterface.
Использование
$result = CurlFactory::finish( $handler, \YoastSEO_Vendor\GuzzleHttp\Handler\EasyHandle $easy, \YoastSEO_Vendor\GuzzleHttp\Handler\CurlFactoryInterface $factory );
- $handler(callable) (обязательный)
- $easy(EasyHandle) (обязательный)
- $factory(CurlFactoryчислоerface) (обязательный)
- Dictates how the handle is released
Код CurlFactory::finish() CurlFactory::finish Yoast 15.7
public static function finish(callable $handler, \YoastSEO_Vendor\GuzzleHttp\Handler\EasyHandle $easy, \YoastSEO_Vendor\GuzzleHttp\Handler\CurlFactoryInterface $factory)
{
if (isset($easy->options['on_stats'])) {
self::invokeStats($easy);
}
if (!$easy->response || $easy->errno) {
return self::finishError($handler, $easy, $factory);
}
// Return the response if it is present and there is no error.
$factory->release($easy);
// Rewind the body of the response if possible.
$body = $easy->response->getBody();
if ($body->isSeekable()) {
$body->rewind();
}
return new \YoastSEO_Vendor\GuzzleHttp\Promise\FulfilledPromise($easy->response);
}