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

Client   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 25
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A post() 0 4 1
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