Passed
Push — master ( e5e694...addfa6 )
by Carsten
01:58
created

RestClient::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Lenius\Economic;
4
5
use Lenius\Economic\API\Client;
6
use Lenius\Economic\API\Request;
7
8
class RestClient
9
{
10
    /**
11
     * Contains the Economic_Request object.
12
     **/
13
    public $request;
14
15
    /**
16
     * __construct function.
17
     *
18
     * Instantiates the main class.
19
     * Creates a client which is passed to the request construct.
20
     *
21
     * @auth_string string Authentication string for Economic
22
     *
23
     * @param string $secret_token
24
     * @param string $grant_token
25
     *
26
     * @throws API\Exception
27
     */
28 4
    public function __construct($secret_token = '', $grant_token = '')
29
    {
30 4
        $client = new Client($secret_token, $grant_token);
31 4
        $this->request = new Request($client);
32 4
    }
33
}
34