| @@ 60-69 (lines=10) @@ | ||
| 57 | $this->timeout = $timeout; |
|
| 58 | } |
|
| 59 | ||
| 60 | public static function create(LoopInterface $loop, string $token, float $timeout = 5.3): self |
|
| 61 | { |
|
| 62 | $resolverFactory = new ResolverFactory(); |
|
| 63 | $resolver = $resolverFactory->createCached('8.8.8.8', $loop); |
|
| 64 | ||
| 65 | $factory = new HttpClientFactory(); |
|
| 66 | $httpClient = $factory->create($loop, $resolver); |
|
| 67 | ||
| 68 | return new self($loop, $httpClient, $token, $timeout); |
|
| 69 | } |
|
| 70 | ||
| 71 | public static function createFromHttpClient( |
|
| 72 | LoopInterface $loop, |
|
| @@ 28-37 (lines=10) @@ | ||
| 25 | $this->token = $token; |
|
| 26 | } |
|
| 27 | ||
| 28 | public static function create(LoopInterface $loop, string $token): self |
|
| 29 | { |
|
| 30 | $resolverFactory = new ResolverFactory(); |
|
| 31 | $resolver = $resolverFactory->createCached('8.8.8.8', $loop); |
|
| 32 | ||
| 33 | $factory = new HttpClientFactory(); |
|
| 34 | $httpClient = $factory->create($loop, $resolver); |
|
| 35 | ||
| 36 | return new self($httpClient, $token); |
|
| 37 | } |
|
| 38 | ||
| 39 | public static function createFromHttpClient(Client $httpClient, string $token): self |
|
| 40 | { |
|