Passed
Push — master ( 22ad80...fa0027 )
by Gabor
08:44
created

Client::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * WebHemi.
4
 *
5
 * PHP version 7.1
6
 *
7
 * @copyright 2012 - 2017 Gixx-web (http://www.gixx-web.com)
8
 * @license   https://opensource.org/licenses/MIT The MIT License (MIT)
9
 *
10
 * @link      http://www.gixx-web.com
11
 */
12
declare(strict_types = 1);
13
14
namespace WebHemi\Http\ServiceAdapter\GuzzleHttp;
15
16
use GuzzleHttp\Client as GuzzleClient;
17
use GuzzleHttp\Message\ResponseInterface;
18
use WebHemi\Http\ClientInterface;
19
20
/**
21
 * Class HttpClient
22
 */
23
class Client implements ClientInterface
24
{
25
    /** @var GuzzleClient */
26
    private $guzzleClient;
27
28
    /**
29
     * HttpClient constructor.
30
     */
31
    public function __construct()
32
    {
33
        $this->guzzleClient = new GuzzleClient();
34
    }
35
36
    /**
37
     * Posts data.
38
     *
39
     * @param string $url
40
     * @param array $data
41
     * @return ResponseInterface
42
     */
43
    public function post(string $url, array $data) : ResponseInterface
44
    {
45
        return $this->guzzleClient->post($url, $data);
46
    }
47
}
48