Setup   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 12
Bugs 3 Features 0
Metric Value
wmc 3
c 12
b 3
f 0
lcom 1
cbo 2
dl 0
loc 49
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 7 2
A __construct() 0 5 1
1
<?php
2
namespace Perry;
3
4
use Perry\Cache\NoCache\NoCachePool;
5
use Perry\Fetcher\GuzzleFetcher;
6
7
final class Setup
8
{
9
    /**
10
     * @var Setup
11
     */
12
    private static $myInstance;
13
14
    /**
15
     * @var \Perry\Fetcher\CanFetch
16
     */
17
    public $fetcher;
18
19
    /**
20
     * @var \Psr\Cache\PoolInterface
21
     */
22
    public $cacheImplementation;
23
24
    /**
25
     * singleton implementation
26
     * @return Setup
27
     */
28
    public static function getInstance()
29
    {
30
        if (!isset(self::$myInstance)) {
31
            self::$myInstance = new Setup();
32
        }
33
        return self::$myInstance;
34
    }
35
36
    /**
37
     * private constructor (singleton, creates defaults)
38
     */
39
    private function __construct()
40
    {
41
        $this->fetcher = new GuzzleFetcher();
42
        $this->cacheImplementation = new NoCachePool();
43
    }
44
45
    public static $crestUrl = "http://public-crest.eveonline.com";
46
    public static $thoraUrl = "http://thora.3rdpartyeve.net";
47
    public static $bindToIp = "0.0.0.0:0";
48
    public static $cacheTTL = 300; // 5 minutes default
49
    public static $userAgent = "( Unknown PHP Application )";
50
51
    /**
52
     * @var array can be used to pass additional options to the fetcher
53
     */
54
    public static $fetcherOptions = [];
55
}
56