PluginProbe
DecaLog / 4.4.0
DecaLog v4.4.0
3.0.2 3.1.0 3.10.0 3.2.0 3.3.0 3.4.0 3.4.1 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.6.3 3.7.0 3.7.1 3.8.0 3.9.0 3.9.1 4.0.0 4.1.0 4.2.0 4.3.0 4.3.1 4.4.0 4.5.0 All 75 releases
decalog / includes / libraries / http / discovery / HttpAsyncClientDiscovery.php

HttpAsyncClientDiscovery.php in DecaLog 4.4.0, at includes/libraries/http/discovery/HttpAsyncClientDiscovery.php

33 lines 869 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Http\Discovery;
4
5 use Http\Client\HttpAsyncClient;
6 use Http\Discovery\Exception\DiscoveryFailedException;
7
8 /**
9 * Finds an HTTP Asynchronous Client.
10 *
11 * @author Joel Wurtz <joel.wurtz@gmail.com>
12 */
13 final class HttpAsyncClientDiscovery extends ClassDiscovery
14 {
15 /**
16 * Finds an HTTP Async Client.
17 *
18 * @return HttpAsyncClient
19 *
20 * @throws Exception\NotFoundException
21 */
22 public static function find()
23 {
24 try {
25 $asyncClient = static::findOneByType(HttpAsyncClient::class);
26 } catch (DiscoveryFailedException $e) {
27 throw new NotFoundException('No HTTPlug async clients found. Make sure to install a package providing "php-http/async-client-implementation". Example: "php-http/guzzle6-adapter".', 0, $e);
28 }
29
30 return static::instantiateClass($asyncClient);
31 }
32 }
33