GuzzleClient::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 12
rs 9.9666
1
<?php
2
3
4
namespace FNDEV\vShpare\Client;
5
6
use FNDEV\vShpare\VmwareApiClient;
7
use FNDEV\vShpare\Auth\SessionHandler;
8
use GuzzleHttp\Client;
9
10
class GuzzleClient extends Client
11
{
12
    public function __construct(VmwareApiClient $client,array $config = [])
13
    {
14
        $guzzleConfig = array_merge([
15
            'base_uri' => $client->getBaseUrl(),
16
            "verify"=>$client->ssl,
17
            'headers' => [
18
                'Vmware-Api-Session-Id' => SessionHandler::getSession($client),
19
                'Content-Type' => 'application/json',
20
                "Accept"=>"application/json"
21
            ],
22
        ], $config);
23
        parent::__construct($guzzleConfig);
24
25
    }
26
27
}