Passed
Pull Request — master (#57)
by
unknown
08:52
created

QuickPay   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 44
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setHeaders() 0 4 1
1
<?php
2
namespace QuickPay;
3
4
use QuickPay\API\Client;
5
use QuickPay\API\Request;
6
7
class QuickPay
8
{
9
    /**
10
     * Contains the QuickPay_Request object
11
     *
12
     * @access public
13
     **/
14
    public $request;
15
16
    /**
17
     * @access protected
18
     */
19
    protected $client;
20
21
    /**
22
    * __construct function.
23
    *
24
    * Instantiates the main class.
25
    * Creates a client which is passed to the request construct.
26
    *
27
    * @auth_string string Authentication string for QuickPay
28
    *
29
    * @access public
30
    */
31
    public function __construct($auth_string = '', $additional_headers = array())
32
    {
33
        $this->client = new Client($auth_string, $additional_headers);
34
        $this->request = new Request($this->client);
35
    }
36
37
    /**
38
     * Add additional headers to request.
39
     *
40
     * This could be used when need to test a callback url in dev mode
41
     *
42
     *      QuickPay-Callback-Url: http://text.url/callback
43
     *
44
     * @access public
45
     */
46
    public function setHeaders($additional_headers = array())
47
    {
48
        $this->client->setHeaders($additional_headers);
49
    }
50
}
51