Passed
Push — master ( a979ef...44e6f2 )
by Jonathan
09:57 queued 01:06
created

ReportingCloud   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 10
Bugs 0 Features 0
Metric Value
wmc 3
dl 0
loc 35
ccs 13
cts 13
cp 1
rs 10
c 10
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 3
1
<?php
2
3
/**
4
 * ReportingCloud PHP Wrapper
5
 *
6
 * PHP wrapper for ReportingCloud Web API. Authored and supported by Text Control GmbH.
7
 *
8
 * @link      http://www.reporting.cloud to learn more about ReportingCloud
9
 * @link      https://github.com/TextControl/txtextcontrol-reportingcloud-php for the canonical source repository
10
 * @license   https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-php/master/LICENSE.md
11
 * @copyright © 2018 Text Control GmbH
12
 */
13
14
namespace TxTextControl\ReportingCloud;
15
16
/**
17
 * Class ReportingCloud
18
 *
19
 * @package TxTextControl\ReportingCloud
20
 * @author  Jonathan Maron (@JonathanMaron)
21
 */
22
class ReportingCloud extends AbstractReportingCloud
23
{
24
    use BuildTrait;
25
    use DeleteTrait;
26
    use GetTrait;
27
    use PostTrait;
28
    use PutTrait;
29
    use UtilityTrait;
30
31
    /**
32
     * Constructor Method
33
     * -----------------------------------------------------------------------------------------------------------------
34
     */
35
36
    /**
37
     * ReportingCloud constructor
38
     *
39
     * @param array $options
40
     */
41 132
    public function __construct(array $options = [])
42
    {
43
        $methods = [
44 132
            'api_key'  => 'setApiKey',
45 66
            'base_uri' => 'setBaseUri',
46 66
            'debug'    => 'setDebug',
47 66
            'password' => 'setPassword',
48 66
            'test'     => 'setTest',
49 66
            'timeout'  => 'setTimeout',
50 66
            'username' => 'setUsername',
51 66
            'version'  => 'setVersion',
52 66
        ];
53
54 132
        foreach ($methods as $key => $method) {
55 132
            if (array_key_exists($key, $options)) {
56 67
                $this->$method($options[$key]);
57 1
            }
58 66
        }
59 132
    }
60
}
61