PayWithBank3D::setup()   A
last analyzed

Complexity

Conditions 4
Paths 3

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 4
nc 3
nop 3
1
<?php
2
3
namespace ParkwayProjects\PayWithBank3D;
4
5
use ParkwayProjects\PayWithBank3D\Exceptions\Exceptions;
6
7
class PayWithBank3D
8
{
9
    public static $baseUrl = [
10
        'staging' => 'https://staging.paywithbank3d.com/api/',
11
        'live' => 'https://paywithbank3d.com/api/',
12
    ];
13
14
    public static $mode;
15
    /**
16
     * @var null
17
     */
18
    public static $secretKey;
19
20
    public static $publicKey;
21
22
    public static function setup($publicKey, $secretKey, $mode = 'live')
23
    {
24
        if (empty($secretKey) || empty($publicKey)) {
25
            throw Exceptions::create('format.is_null');
26
        }
27
        if (empty($mode)) {
28
            throw Exceptions::create('format.null_mode');
29
        }
30
31
        self::$secretKey = $secretKey;
32
        self::$publicKey = $publicKey;
33
        self::$mode = $mode;
34
    }
35
}
36