HttpClient   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 36
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildRequestUri() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of GetCake PHP Client.
5
 *
6
 * (c) DraperStudio <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Apivore\GetCake;
13
14
use Apivore\Core\AbstractHttpClient;
15
use Apivore\GetCake\Request\Modifiers\ApiKeyModifier;
16
use Apivore\GetCake\Request\Modifiers\BaseUriModifier;
17
use Apivore\GetCake\Request\Modifiers\AffiliateIdModifier;
18
19
/**
20
 * Class HttpClient.
21
 */
22
class HttpClient extends AbstractHttpClient
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27
    protected $options = [
28
        'headers' => [
29
           'User-Agent' => 'Apivore/GetCake',
30
        ],
31
    ];
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    protected $requestModifiers = [
37
        BaseUriModifier::class,
38
        AffiliateIdModifier::class,
39
        ApiKeyModifier::class,
40
    ];
41
42
    /**
43
     * @var string
44
     */
45
    protected $responseFormat = 'xml';
46
47
    /**
48
     * @param $baseUri
49
     * @param $path
50
     *
51
     * @return string
52
     */
53
    protected function buildRequestUri($baseUri, $path)
54
    {
55
        return $baseUri.'/affiliates/api/'.$path;
56
    }
57
}
58