Completed
Push — master ( 604af5...065776 )
by Dan
01:36
created

Guzzle::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
namespace Nopolabs\Yabot\Guzzle;
3
4
5
use GuzzleHttp\Client;
6
use GuzzleHttp\Handler\CurlMultiHandler;
7
use GuzzleHttp\Promise\PromiseInterface;
8
use function GuzzleHttp\Promise\queue;
9
use Psr\Http\Message\ResponseInterface;
10
use React\EventLoop\LoopInterface;
11
use React\EventLoop\Timer\TimerInterface;
12
13
class Guzzle
14
{
15
    /** @var Client */
16
    private $client;
17
18
    public function __construct(Client $client)
19
    {
20
        $this->client = $client;
21
    }
22
23
    public function getClient() : Client
24
    {
25
        return $this->client;
26
    }
27
28
    public function getAsync(string $uri, array $options = []) : PromiseInterface
29
    {
30
        return $this->client->getAsync($uri, $options);
31
    }
32
33
    public function postAsync(string $uri, array $options = []) : PromiseInterface
34
    {
35
        return $this->client->postAsync($uri, $options);
36
    }
37
38
    public function get(string $uri, array $options = []) : ResponseInterface
39
    {
40
        return $this->client->get($uri, $options);
41
    }
42
43
    public function post(string $uri, array $options = []) : ResponseInterface
44
    {
45
        return $this->client->post($uri, $options);
46
    }
47
}