JeniusHttpInstance   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A __clone() 0 2 1
A getJeniusHttp() 0 15 2
1
<?php
2
3
namespace Jenius;
4
5
class JeniusHttpInstance
6
{
7
    private static $instance = null;
8
    private static $x_channel_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 getJeniusHttp()
30
    {
31
        if (self::$instance !== null) {
32
            return self::$instance;
33
        }
34
35
        self::$instance = new JeniusHttp(
36
            self::$x_channel_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