BcaHttpInstance   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 23
dl 0
loc 39
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A __clone() 0 2 1
A getBcaHttp() 0 15 2
1
<?php
2
3
namespace Bca;
4
5
class BcaHttpInstance
6
{
7
    private static $instance      = null;
8
    private static $corp_id       = '';
9
    private static $client_id     = '';
10
    private static $client_secret = '';
11
    private static $api_key       = '';
12
    private static $secret_key    = '';
13
    private static $options = array(
14
        'scheme'        => 'https',
15
        'port'          => 443,
16
        'timezone'      => 'Asia/Jakarta',
17
        'timeout'       => null,
18
        'development'   => true,
19
    );
20
21
    private function __construct()
22
    {
23
    }
24
25
    private function __clone()
26
    {
27
    }
28
29
    public static function getBcaHttp()
30
    {
31
        if (self::$instance !== null) {
32
            return self::$instance;
33
        }
34
35
        self::$instance = new BcaHttp(
36
            self::$corp_id,
37
            self::$client_id,
38
            self::$client_secret,
39
            self::$api_key,
40
            self::$secret_key,
41
            self::$options
42
        );
43
        return self::$instance;
44
    }
45
}
46