DataRequest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
c 3
b 0
f 0
lcom 0
cbo 2
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php namespace StarCraftApiClient\Requests;
2
3
use StarCraftApiClient\Client;
4
5
/**
6
 * @author neun
7
 * @since  2015-10-25
8
 */
9
class DataRequest extends Request
10
{
11
12
    /**
13
     * DataRequest constructor.
14
     * @param Client $client
15
     * @param string $type
16
     * @param $region
17
     */
18
    public function __construct($client, $type, $region)
19
    {
20
        $url = 'https://%s.api.battle.net/sc2/data/%s?locale=%s&apikey=%s';
21
22
        if (in_array($type, ['achievements', 'rewards'])) {
23
            $this->url =
24
                sprintf($url, $region, $type, $client->language(), $client->apiToken());
25
        }
26
    }
27
}
28