PayWithBank3D   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 29
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setup() 0 13 4
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