Completed
Pull Request — master (#4)
by Ruben
03:24
created

Guzzle5ApiClient   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 24
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A _doRequest() 0 11 1
1
<?php
2
3
namespace MovingImage\Client\VMPro\ApiClient;
4
5
use MovingImage\Client\VMPro\ApiClient;
6
use MovingImage\Client\VMPro\Interfaces\ApiClientInterface;
7
8
/**
9
 * Class Guzzle5ApiClient.
10
 *
11
 * @author Ruben Knol <[email protected]>
12
 */
13
class Guzzle5ApiClient extends ApiClient implements ApiClientInterface
14
{
15
    /**
16
     * Guzzle5 Client implementation for making HTTP requests with
17
     * the appropriate options.
18
     *
19
     * @param string $method
20
     * @param string $uri
21
     * @param array  $options
22
     *
23
     * @return \GuzzleHttp\Message\ResponseInterface
24
     */
25 3
    protected function _doRequest($method, $uri, $options)
26
    {
27
        // For Guzzle5 we cannot have any options that are not pre-defined,
28
        // so instead we put it in the config array
29 3
        $options['config']['videoManagerId'] = $options['videoManagerId'];
30 3
        unset($options['videoManagerId']);
31
32 3
        $request = $this->httpClient->createRequest($method, $uri, $options);
0 ignored issues
show
Bug introduced by
The method createRequest() does not exist on GuzzleHttp\ClientInterface. Did you maybe mean request()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
33
34 3
        return $this->httpClient->send($request);
35
    }
36
}
37